aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/mjpegdec.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-01-11 18:19:53 +0100
committerMichael Niedermayer <michaelni@gmx.at>2013-01-11 18:20:25 +0100
commit969e75eb80dad51481152f868dafa802579a19aa (patch)
tree4890ae40916f891e8415215d229d606e3603b99e /libavcodec/mjpegdec.c
parente5e422bcc3e6deee8c5c5bf8f5aeca2c051542f5 (diff)
downloadffmpeg-969e75eb80dad51481152f868dafa802579a19aa.tar.gz
mjpegdec: Fix out of array read in unescaping code
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/mjpegdec.c')
-rw-r--r--libavcodec/mjpegdec.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/mjpegdec.c b/libavcodec/mjpegdec.c
index 78af858695..78a0453d57 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;
}
}