You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-15 14:13:16 +02:00
jpeg2000: Validate block lengthinc
Currently we are using an array with a static data size. Similar to a patch with the same purpose by Michael Niedermayer. Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
This commit is contained in:
@@ -663,6 +663,12 @@ static int jpeg2000_decode_packet(Jpeg2000DecoderContext *s,
|
|||||||
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;
|
||||||
|
if (ret > sizeof(cblk->data)) {
|
||||||
|
avpriv_request_sample(s->avctx,
|
||||||
|
"Block with lengthinc greater than %zu",
|
||||||
|
sizeof(cblk->data));
|
||||||
|
return AVERROR_PATCHWELCOME;
|
||||||
|
}
|
||||||
cblk->lengthinc = ret;
|
cblk->lengthinc = ret;
|
||||||
cblk->npasses += newpasses;
|
cblk->npasses += newpasses;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user