[FFmpeg-cvslog] j2kdec: Check curtileno for validity

Michael Niedermayer git at videolan.org
Thu Jan 12 22:25:52 CET 2012


ffmpeg | branch: release/0.7 | Michael Niedermayer <michaelni at gmx.at> | Sat Dec 24 05:06:20 2011 +0100| [6b4c38b362a59a28860e0e2e3d92a82dc38479cc] | committer: Michael Niedermayer

j2kdec: Check curtileno for validity

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
(cherry picked from commit 3eedf9f716733b3b4c5205726d2c1ca52b3d3d78)

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=6b4c38b362a59a28860e0e2e3d92a82dc38479cc
---

 libavcodec/j2kdec.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/libavcodec/j2kdec.c b/libavcodec/j2kdec.c
index 96b4f64..3b94497 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)
 



More information about the ffmpeg-cvslog mailing list