aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2016-01-21 21:01:47 +0100
committerMichael Niedermayer <michael@niedermayer.cc>2016-01-31 00:24:52 +0100
commit58ea532cad816858e0bffefd8c00e5256b531472 (patch)
tree031669357ffa668d711d73e749b08cb8a69bec51
parent0ec1ffcb4db43d0a635e3bfcdc648c1a372fdb0b (diff)
downloadffmpeg-58ea532cad816858e0bffefd8c00e5256b531472.tar.gz
avcodec/mjpegdec: Check for end for both bytes in unescaping
Fixes assertion failure Fixes: c40c779601b77dc6e19aaea0b04b9751/signal_sigabrt_7ffff6ae7cb7_5769_b94f6ec70caecb2d3d76b4771b109ac1.avi Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit 509c9e74e548139285f30ed8dcc9baf1d64359fa) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavcodec/mjpegdec.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/mjpegdec.c b/libavcodec/mjpegdec.c
index 439365f7ef..d77940f3ef 100644
--- a/libavcodec/mjpegdec.c
+++ b/libavcodec/mjpegdec.c
@@ -1942,7 +1942,7 @@ int ff_mjpeg_find_marker(MJpegDecodeContext *s,
while (b < t) {
uint8_t x = src[b++];
put_bits(&pb, 8, x);
- if (x == 0xFF) {
+ if (x == 0xFF && b < t) {
x = src[b++];
if (x & 0x80) {
av_log(s->avctx, AV_LOG_WARNING, "Invalid escape sequence\n");