avcodec/jpeg2000dec: Add some additional checking on lengthinc
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
@@ -807,6 +807,12 @@ static int jpeg2000_decode_packet(Jpeg2000DecoderContext *s,
|
|||||||
return newpasses;
|
return newpasses;
|
||||||
if ((llen = getlblockinc(s)) < 0)
|
if ((llen = getlblockinc(s)) < 0)
|
||||||
return llen;
|
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;
|
cblk->lblock += llen;
|
||||||
if ((ret = get_bits(s, av_log2(newpasses) + cblk->lblock)) < 0)
|
if ((ret = get_bits(s, av_log2(newpasses) + cblk->lblock)) < 0)
|
||||||
return ret;
|
return ret;
|
||||||
|
Reference in New Issue
Block a user