From: Michael Niedermayer <[email protected]> Avoid overread.
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <[email protected]> --- libavcodec/jpeg2kdec.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/libavcodec/jpeg2kdec.c b/libavcodec/jpeg2kdec.c index caf435c..8494327 100644 --- a/libavcodec/jpeg2kdec.c +++ b/libavcodec/jpeg2kdec.c @@ -343,6 +343,13 @@ static int get_cod(Jpeg2KDecoderContext *s, Jpeg2KCodingStyle *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; -- 1.7.9.5 _______________________________________________ libav-devel mailing list [email protected] https://lists.libav.org/mailman/listinfo/libav-devel
