mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-12-23 12:43:46 +02:00
jpeg2000dec: return error for invalid cdxy values
Fixes division by 0 Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
702c1bf240
commit
bbc19010ed
@ -194,6 +194,8 @@ static int get_siz(Jpeg2000DecoderContext *s)
|
||||
s->cdy[i] = bytestream2_get_byteu(&s->g);
|
||||
if (s->cdx[i] != 1 || s->cdy[i] != 1) {
|
||||
av_log(s->avctx, AV_LOG_ERROR, "unsupported/ CDxy values %d %d for component %d\n", s->cdx[i], s->cdy[i], i);
|
||||
if (!s->cdx[i] || !s->cdy[i])
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user