diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2012-11-12 20:27:29 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-11-12 20:27:57 +0100 |
commit | a9456c7c5ca883b5a3947e59a9fba5587e18e119 (patch) | |
tree | 1e015d07e7faad54dbe49948325a01d4edf37965 /libavcodec | |
parent | abe68364a3219f1a98c46bddea575e4cada147c7 (diff) | |
download | ffmpeg-a9456c7c5ca883b5a3947e59a9fba5587e18e119.tar.gz |
mjpegdec: tighten unescaped_buf_size size check, prevent null ptr deref
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/mjpegdec.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/mjpegdec.c b/libavcodec/mjpegdec.c index 0a71a6f5ab..ae0e504674 100644 --- a/libavcodec/mjpegdec.c +++ b/libavcodec/mjpegdec.c @@ -1611,7 +1611,7 @@ int ff_mjpeg_decode_frame(AVCodecContext *avctx, void *data, int *data_size, /* EOF */ if (start_code < 0) { goto the_end; - } else if (unescaped_buf_size > (1U<<29)) { + } else if (unescaped_buf_size > (1U<<28)) { av_log(avctx, AV_LOG_ERROR, "MJPEG packet 0x%x too big (0x%x/0x%x), corrupt data?\n", start_code, unescaped_buf_size, buf_size); return AVERROR_INVALIDDATA; |