[FFmpeg-cvslog] sanm: remove "duplicate" for loop.

Michael Niedermayer git at videolan.org
Tue Jan 22 22:51:15 CET 2013


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Tue Jan 22 22:28:41 2013 +0100| [1bb05797ec27a0a2b921c18466f898b23c4a9740] | committer: Michael Niedermayer

sanm: remove "duplicate" for loop.

Fixes input buffer overread

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=1bb05797ec27a0a2b921c18466f898b23c4a9740
---

 libavcodec/sanm.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/libavcodec/sanm.c b/libavcodec/sanm.c
index ff70f20..db22fc9 100644
--- a/libavcodec/sanm.c
+++ b/libavcodec/sanm.c
@@ -652,8 +652,7 @@ static int old_codec47(SANMVideoContext *ctx, int top,
         if (bytestream2_get_bytes_left(&ctx->gb) < width * height)
             return AVERROR_INVALIDDATA;
         for (j = 0; j < height; j++) {
-            for (i = 0; i < width; i++)
-                bytestream2_get_bufferu(&ctx->gb, dst, width);
+            bytestream2_get_bufferu(&ctx->gb, dst, width);
             dst += stride;
         }
         break;



More information about the ffmpeg-cvslog mailing list