libavcodec/jpeg2000dec.c:133: error: Buffer Overrun L3
  Offset: [-1, +oo] Size: 30.

libavcodec/jpeg2000dec.c:120:5: <Offset trace>
118. {
119.     Jpeg2000TgtNode *stack[30];
120.     int sp = -1, curval = 0;
         ^
121. 
122.     if (!node)

libavcodec/jpeg2000dec.c:120:5: Assignment
118. {
119.     Jpeg2000TgtNode *stack[30];
120.     int sp = -1, curval = 0;
         ^
121. 
122.     if (!node)

libavcodec/jpeg2000dec.c:116:1: <Length trace>
114. 
115. /* decode the value stored in node */
116. static int tag_tree_decode(Jpeg2000DecoderContext *s, Jpeg2000TgtNode *node,
     ^
117.                            int threshold)
118. {

libavcodec/jpeg2000dec.c:116:1: Array declaration
114. 
115. /* decode the value stored in node */
116. static int tag_tree_decode(Jpeg2000DecoderContext *s, Jpeg2000TgtNode *node,
     ^
117.                            int threshold)
118. {

libavcodec/jpeg2000dec.c:133:18: Array access: Offset: [-1, +oo] Size: 30
131.         curval = node->val;
132.     else
133.         curval = stack[sp]->val;
                      ^
134. 
135.     while (curval < threshold && sp >= 0) {

static int tag_tree_decode(Jpeg2000DecoderContext *s, Jpeg2000TgtNode *node,
                           int threshold)
{
    Jpeg2000TgtNode *stack[30];
    int sp = -1, curval = 0;
    if (!node)
        return AVERROR_INVALIDDATA;
    while (node && !node->vis) {
        stack[++sp] = node;
        node        = node->parent;
    }
    if (node)
        curval = node->val;
    else
        curval = stack[sp]->val;
    while (curval < threshold && sp >= 0) {
        if (curval < stack[sp]->val)
            curval = stack[sp]->val;
        while (curval < threshold) {
            int ret;
            if ((ret = get_bits(s, 1)) > 0) {
                stack[sp]->vis++;
                break;
            } else if (!ret)
                curval++;
            else
                return ret;
        }
        stack[sp]->val = curval;
        sp--;
    }
    return curval;
}
['static int tag_tree_decode(Jpeg2000DecoderContext *s, Jpeg2000TgtNode *node,\n                           int threshold)\n{\n    Jpeg2000TgtNode *stack[30];\n    int sp = -1, curval = 0;\n    if (!node)\n        return AVERROR_INVALIDDATA;\n    while (node && !node->vis) {\n        stack[++sp] = node;\n        node        = node->parent;\n    }\n    if (node)\n        curval = node->val;\n    else\n        curval = stack[sp]->val;\n    while (curval < threshold && sp >= 0) {\n        if (curval < stack[sp]->val)\n            curval = stack[sp]->val;\n        while (curval < threshold) {\n            int ret;\n            if ((ret = get_bits(s, 1)) > 0) {\n                stack[sp]->vis++;\n                break;\n            } else if (!ret)\n                curval++;\n            else\n                return ret;\n        }\n        stack[sp]->val = curval;\n        sp--;\n    }\n    return curval;\n}']