diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2011-12-24 05:06:20 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-01-12 21:54:42 +0100 |
commit | 6b4c38b362a59a28860e0e2e3d92a82dc38479cc (patch) | |
tree | 9a65135c7b61e55bb1138a8c3d9f79a4e3b63f7f /libavcodec | |
parent | 049b08d04cd5a6e53e0b0814525313fe5bd3e47a (diff) | |
download | ffmpeg-6b4c38b362a59a28860e0e2e3d92a82dc38479cc.tar.gz |
j2kdec: Check curtileno for validity
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 3eedf9f716733b3b4c5205726d2c1ca52b3d3d78)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/j2kdec.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/libavcodec/j2kdec.c b/libavcodec/j2kdec.c index 96b4f64098..3b94497293 100644 --- a/libavcodec/j2kdec.c +++ b/libavcodec/j2kdec.c @@ -421,6 +421,10 @@ static uint8_t get_sot(J2kDecoderContext *s) return AVERROR(EINVAL); s->curtileno = bytestream_get_be16(&s->buf); ///< Isot + if((unsigned)s->curtileno >= s->numXtiles * s->numYtiles){ + s->curtileno=0; + return AVERROR(EINVAL); + } s->buf += 4; ///< Psot (ignored) |