aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-07-01 10:01:30 +0200
committerLuca Barbato <lu_zero@gentoo.org>2013-07-02 20:05:47 +0200
commit09d5929f3721613fbb9ac9e74265c89c70df2ce0 (patch)
tree250ec71d952db5a265cdd74f60635d236a0c652a
parentaa16bbaf9bcaef880f70c834d46cb51cf823722f (diff)
downloadffmpeg-09d5929f3721613fbb9ac9e74265c89c70df2ce0.tar.gz
jpeg2000: Do not crash on NULL node in tag_tree_decode
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
-rw-r--r--libavcodec/jpeg2000dec.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/libavcodec/jpeg2000dec.c b/libavcodec/jpeg2000dec.c
index ac44a29ff1..172314f40a 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;