tag_tree_decode: check node being non null
authorMichael Niedermayer <michaelni@gmx.at>
Sun, 14 Oct 2012 20:00:04 +0000 (22:00 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Sun, 14 Oct 2012 20:16:31 +0000 (22:16 +0200)
Fixes CID717843
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavcodec/j2kdec.c

index b2624f9..c712eb3 100644 (file)
@@ -167,6 +167,9 @@ static int tag_tree_decode(J2kDecoderContext *s, J2kTgtNode *node, int threshold
     J2kTgtNode *stack[30];
     int sp = -1, curval = 0;
 
     J2kTgtNode *stack[30];
     int sp = -1, curval = 0;
 
+    if(!node)
+        return AVERROR(EINVAL);
+
     while(node && !node->vis){
         stack[++sp] = node;
         node = node->parent;
     while(node && !node->vis){
         stack[++sp] = node;
         node = node->parent;