[FFmpeg-cvslog] mjpegdec: Fix out of array read in unescaping code

Michael Niedermayer git at videolan.org
Fri Jan 11 18:33:51 CET 2013


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Fri Jan 11 18:19:53 2013 +0100| [969e75eb80dad51481152f868dafa802579a19aa] | committer: Michael Niedermayer

mjpegdec: Fix out of array read in unescaping code

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=969e75eb80dad51481152f868dafa802579a19aa
---

 libavcodec/mjpegdec.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/mjpegdec.c b/libavcodec/mjpegdec.c
index 78af858..78a0453 100644
--- a/libavcodec/mjpegdec.c
+++ b/libavcodec/mjpegdec.c
@@ -1590,7 +1590,7 @@ int ff_mjpeg_find_marker(MJpegDecodeContext *s,
                 while ((src + t < buf_end) && x == 0xff)
                     x = src[t++];
                 if (x & 0x80) {
-                    t -= 2;
+                    t -= FFMIN(2, t);
                     break;
                 }
             }



More information about the ffmpeg-cvslog mailing list