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>2011-12-24 18:42:55 +0100
commit3eedf9f716733b3b4c5205726d2c1ca52b3d3d78 (patch)
treed25f9c2beac278815c0d828d67d7ad660bf40d48 /libavcodec
parent3132999fdb57d8d3ba5e08a4dc1b3661e885c04d (diff)
downloadffmpeg-3eedf9f716733b3b4c5205726d2c1ca52b3d3d78.tar.gz
j2kdec: Check curtileno for validity
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 c8dabc0bde..4e11030cb8 100644
--- a/libavcodec/j2kdec.c
+++ b/libavcodec/j2kdec.c
@@ -427,6 +427,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)