Commit cf9ab119 authored by Michael Niedermayer's avatar Michael Niedermayer

avcodec/mjpegdec: Check len in ff_mjpeg_decode_dht()

Fixes CID1239167
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent dc35a581
...@@ -204,6 +204,11 @@ int ff_mjpeg_decode_dht(MJpegDecodeContext *s) ...@@ -204,6 +204,11 @@ int ff_mjpeg_decode_dht(MJpegDecodeContext *s)
len = get_bits(&s->gb, 16) - 2; 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) { while (len > 0) {
if (len < 17) if (len < 17)
return AVERROR_INVALIDDATA; return AVERROR_INVALIDDATA;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment