1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-02-04 06:08:26 +02:00

get_qcc: Check compno

Fixes out of array accesses

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2013-06-06 02:19:24 +02:00
parent b28851a1d6
commit c59ce1c98e

View File

@ -425,6 +425,11 @@ static int get_qcc(Jpeg2000DecoderContext *s, int n, Jpeg2000QuantStyle *q,
return AVERROR(EINVAL);
compno = bytestream2_get_byteu(&s->g);
if (compno >= s->ncomponents) {
av_log(s->avctx, AV_LOG_ERROR, "Invalid compno\n");
return AVERROR_INVALIDDATA;
}
properties[compno] |= HAD_QCC;
return get_qcx(s, n - 1, q + compno);
}