mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-01-24 13:56:33 +02:00
jpeg2000: Check that we have enough components for MCT
Avoid overread. Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michaelni@gmx.at> Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
This commit is contained in:
parent
b564784a20
commit
cf04af2086
@ -343,6 +343,13 @@ static int get_cod(Jpeg2000DecoderContext *s, Jpeg2000CodingStyle *c,
|
||||
tmp.nlayers = bytestream2_get_be16u(&s->g);
|
||||
tmp.mct = bytestream2_get_byteu(&s->g); // multiple component transformation
|
||||
|
||||
if (tmp.mct && s->ncomponents < 3) {
|
||||
av_log(s->avctx, AV_LOG_ERROR,
|
||||
"MCT %d with too few components (%d)\n",
|
||||
tmp.mct, s->ncomponents);
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
|
||||
if ((ret = get_cox(s, &tmp)) < 0)
|
||||
return ret;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user