aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2011-12-24 05:06:20 +0100
committerMichael Niedermayer <michaelni@gmx.at>2012-01-12 21:54:42 +0100
commit6b4c38b362a59a28860e0e2e3d92a82dc38479cc (patch)
tree9a65135c7b61e55bb1138a8c3d9f79a4e3b63f7f /libavcodec
parent049b08d04cd5a6e53e0b0814525313fe5bd3e47a (diff)
downloadffmpeg-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.c4
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)