Commit 73ffab41 authored by Michael Niedermayer's avatar Michael Niedermayer

jpeg2000dec: check TPsot

Fixes out of array accesses

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent fec87838
......@@ -432,6 +432,11 @@ static int get_sot(Jpeg2000DecoderContext *s, int n)
/* Read TNSot but not used */
bytestream2_get_byteu(&s->g); // TNsot
if (TPsot >= FF_ARRAY_ELEMS(s->tile[s->curtileno].tile_part)) {
av_log(s->avctx, AV_LOG_ERROR, "TPsot %d too big\n", TPsot);
return AVERROR_PATCHWELCOME;
}
tp = s->tile[s->curtileno].tile_part + TPsot;
tp->tile_index = Isot;
tp->tp_len = Psot;
......
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