[FFmpeg-cvslog] jpeg2000: Do not crash on NULL node in tag_tree_decode

Michael Niedermayer git at videolan.org
Wed Jul 3 16:32:32 CEST 2013


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Mon Jul  1 10:01:30 2013 +0200| [09d5929f3721613fbb9ac9e74265c89c70df2ce0] | committer: Luca Barbato

jpeg2000: Do not crash on NULL node in tag_tree_decode

Signed-off-by: Luca Barbato <lu_zero at gentoo.org>

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

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

diff --git a/libavcodec/jpeg2000dec.c b/libavcodec/jpeg2000dec.c
index ac44a29..172314f 100644
--- a/libavcodec/jpeg2000dec.c
+++ b/libavcodec/jpeg2000dec.c
@@ -119,6 +119,9 @@ static int tag_tree_decode(Jpeg2000DecoderContext *s, Jpeg2000TgtNode *node,
     Jpeg2000TgtNode *stack[30];
     int sp = -1, curval = 0;
 
+    if (!node)
+        return AVERROR_INVALIDDATA;
+
     while (node && !node->vis) {
         stack[++sp] = node;
         node        = node->parent;



More information about the ffmpeg-cvslog mailing list