Commit c59ce1c9 authored by Michael Niedermayer's avatar Michael Niedermayer

get_qcc: Check compno

Fixes out of array accesses

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent b28851a1
......@@ -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);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment