[FFmpeg-cvslog] jpeg2000dec: Add more checks when parsing headers

Martin Storsjö git at videolan.org
Wed Sep 18 10:13:59 CEST 2013


ffmpeg | branch: master | Martin Storsjö <martin at martin.st> | Mon Sep 16 16:17:05 2013 +0300| [18a245a2aea31b92bc435f2962a71e060d83b5f7] | committer: Martin Storsjö

jpeg2000dec: Add more checks when parsing headers

Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable at libav.org
Signed-off-by: Martin Storsjö <martin at martin.st>

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

 libavcodec/jpeg2000dec.c |    4 ++++
 1 file changed, 4 insertions(+)

diff --git a/libavcodec/jpeg2000dec.c b/libavcodec/jpeg2000dec.c
index 61befdf..18346f9 100644
--- a/libavcodec/jpeg2000dec.c
+++ b/libavcodec/jpeg2000dec.c
@@ -1284,6 +1284,10 @@ static int jpeg2000_read_main_headers(Jpeg2000DecoderContext *s)
                 av_log(s->avctx, AV_LOG_ERROR, "Missing SOT\n");
                 return AVERROR_INVALIDDATA;
             }
+            if (!s->tile) {
+                av_log(s->avctx, AV_LOG_ERROR, "Missing SIZ\n");
+                return AVERROR_INVALIDDATA;
+            }
 
             tile = s->tile + s->curtileno;
             tp = tile->tile_part + tile->tp_idx;



More information about the ffmpeg-cvslog mailing list