Commit 5ccca4eb authored by Michael Niedermayer's avatar Michael Niedermayer

avcodec/jpeg2000dec: Add some additional checking on lengthinc

Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 2f1dd4a3
......@@ -807,6 +807,12 @@ static int jpeg2000_decode_packet(Jpeg2000DecoderContext *s,
return newpasses;
if ((llen = getlblockinc(s)) < 0)
return llen;
if (cblk->lblock + llen + av_log2(newpasses) > 16) {
avpriv_request_sample(s->avctx,
"Block with length beyond 16 bits\n");
return AVERROR_PATCHWELCOME;
}
cblk->lblock += llen;
if ((ret = get_bits(s, av_log2(newpasses) + cblk->lblock)) < 0)
return ret;
......
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