diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2012-11-11 00:01:24 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-11-11 01:19:44 +0100 |
commit | 1f41cffe1e3e79620f587545bdfcbd7e6e68ed29 (patch) | |
tree | 3f4b48ecc7014ce7259afe55a445ee79ce7b9a50 /libavcodec/mjpegdec.c | |
parent | e56b0984103b981ec25fe8a22ef9c4905b9751dd (diff) | |
download | ffmpeg-1f41cffe1e3e79620f587545bdfcbd7e6e68ed29.tar.gz |
mjpegdec: check SE.
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.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/libavcodec/mjpegdec.c b/libavcodec/mjpegdec.c index 6b5266de58..0a71a6f5ab 100644 --- a/libavcodec/mjpegdec.c +++ b/libavcodec/mjpegdec.c @@ -1095,6 +1095,11 @@ static int mjpeg_decode_scan_progressive_ac(MJpegDecodeContext *s, int ss, int last_scan = 0; int16_t *quant_matrix = s->quant_matrixes[s->quant_index[c]]; + if (se > 63) { + av_log(s->avctx, AV_LOG_ERROR, "SE %d is too large\n", se); + return AVERROR_INVALIDDATA; + } + if (!Al) { s->coefs_finished[c] |= (1LL << (se + 1)) - (1LL << ss); last_scan = !~s->coefs_finished[c]; |