Commit 32fc8d6d authored by Michael Niedermayer's avatar Michael Niedermayer

avcodec/jpeg2000dec: check that tp_end is after the start

Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 03cd3bec
......@@ -1237,6 +1237,10 @@ static int jpeg2000_read_main_headers(Jpeg2000DecoderContext *s)
tile = s->tile + s->curtileno;
tp = tile->tile_part + tile->tp_idx;
if (tp->tp_end < s->g.buffer) {
av_log(s->avctx, AV_LOG_ERROR, "Invalid tpend\n");
return AVERROR_INVALIDDATA;
}
bytestream2_init(&tp->tpg, s->g.buffer, tp->tp_end - s->g.buffer);
bytestream2_skip(&s->g, tp->tp_end - s->g.buffer);
......
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