ffmpeg | branch: master | Michael Niedermayer <michae...@gmx.at> | Wed May 13 17:41:41 2015 +0200| [cf9ab119d02dd8a80b37df02007d488aae5a2b80] | committer: Michael Niedermayer
avcodec/mjpegdec: Check len in ff_mjpeg_decode_dht() Fixes CID1239167 Signed-off-by: Michael Niedermayer <michae...@gmx.at> > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=cf9ab119d02dd8a80b37df02007d488aae5a2b80 --- libavcodec/mjpegdec.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/libavcodec/mjpegdec.c b/libavcodec/mjpegdec.c index 2e019d9..b3dc246 100644 --- a/libavcodec/mjpegdec.c +++ b/libavcodec/mjpegdec.c @@ -204,6 +204,11 @@ int ff_mjpeg_decode_dht(MJpegDecodeContext *s) len = get_bits(&s->gb, 16) - 2; + if (8*len > get_bits_left(&s->gb)) { + av_log(s->avctx, AV_LOG_ERROR, "dht: len %d is too large\n", len); + return AVERROR_INVALIDDATA; + } + while (len > 0) { if (len < 17) return AVERROR_INVALIDDATA; _______________________________________________ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog