diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2013-06-21 02:31:00 +0400 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-06-21 02:58:41 +0400 |
commit | 32fc8d6db65e5dd380bafcc95a0e840d69a335d2 (patch) | |
tree | b89cce9fd156abb2b649cab52ab731490f43854b | |
parent | 03cd3bec6e66a49bcec138d72bac97cb8a64d246 (diff) |
avcodec/jpeg2000dec: check that tp_end is after the start
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r-- | libavcodec/jpeg2000dec.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/libavcodec/jpeg2000dec.c b/libavcodec/jpeg2000dec.c index caa5ae4e91..dc976c15fb 100644 --- a/libavcodec/jpeg2000dec.c +++ b/libavcodec/jpeg2000dec.c @@ -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); |