From: Michael Niedermayer <[email protected]> Fixes a possible overread.
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <[email protected]> --- libavcodec/jpeg2000dec.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/libavcodec/jpeg2000dec.c b/libavcodec/jpeg2000dec.c index cf56f80..08476d1 100644 --- a/libavcodec/jpeg2000dec.c +++ b/libavcodec/jpeg2000dec.c @@ -485,6 +485,11 @@ static int get_sot(Jpeg2000DecoderContext *s, int n) /* Read TNSot but not used */ bytestream2_get_byteu(&s->g); // TNsot + if (Psot > bytestream2_get_bytes_left(&s->g) + n + 2) { + av_log(s->avctx, AV_LOG_ERROR, "Psot %d too big\n", Psot); + return AVERROR_INVALIDDATA; + } + if (TPsot >= FF_ARRAY_ELEMS(s->tile[Isot].tile_part)) { avpriv_request_sample(s->avctx, "Support for %d components", TPsot); return AVERROR_PATCHWELCOME; -- 1.8.2.1 _______________________________________________ libav-devel mailing list [email protected] https://lists.libav.org/mailman/listinfo/libav-devel
