libavcodec/cook.c:364: error: Integer Overflow L2
  ([0, +oo] - 6):unsigned32.

libavcodec/cook.c:364:28: <LHS trace>
362.     int i, j, vlc_index;
363. 
364.     quant_index_table[0] = bitstream_read(&q->bc, 6) - 6; // This is used later in categorize
                                ^
365. 
366.     for (i = 1; i < p->total_subbands; i++) {

libavcodec/cook.c:364:28: Call
362.     int i, j, vlc_index;
363. 
364.     quant_index_table[0] = bitstream_read(&q->bc, 6) - 6; // This is used later in categorize
                                ^
365. 
366.     for (i = 1; i < p->total_subbands; i++) {

libavcodec/bitstream.h:186:9: Assignment
  184. {
  185.     if (!n)
  186.         return 0;
               ^
  187. 
  188.     if (n > bc->bits_left) {

libavcodec/cook.c:364:5: Binary operation: ([0, +oo] - 6):unsigned32
362.     int i, j, vlc_index;
363. 
364.     quant_index_table[0] = bitstream_read(&q->bc, 6) - 6; // This is used later in categorize
         ^
365. 
366.     for (i = 1; i < p->total_subbands; i++) {

static int decode_envelope(COOKContext *q, COOKSubpacket *p,
                           int *quant_index_table)
{
    int i, j, vlc_index;
    quant_index_table[0] = bitstream_read(&q->bc, 6) - 6;
    for (i = 1; i < p->total_subbands; i++) {
        vlc_index = i;
        if (i >= p->js_subband_start * 2) {
            vlc_index -= p->js_subband_start;
        } else {
            vlc_index /= 2;
            if (vlc_index < 1)
                vlc_index = 1;
        }
        if (vlc_index > 13)
            vlc_index = 13;
        j = bitstream_read_vlc(&q->bc, q->envelope_quant_index[vlc_index - 1].table,
                               q->envelope_quant_index[vlc_index - 1].bits, 2);
        quant_index_table[i] = quant_index_table[i - 1] + j - 12;
        if (quant_index_table[i] > 63 || quant_index_table[i] < -63) {
            av_log(q->avctx, AV_LOG_ERROR,
                   "Invalid quantizer %d at position %d, outside [-63, 63] range\n",
                   quant_index_table[i], i);
            return AVERROR_INVALIDDATA;
        }
    }
    return 0;
}
['static int decode_envelope(COOKContext *q, COOKSubpacket *p,\n                           int *quant_index_table)\n{\n    int i, j, vlc_index;\n    quant_index_table[0] = bitstream_read(&q->bc, 6) - 6;\n    for (i = 1; i < p->total_subbands; i++) {\n        vlc_index = i;\n        if (i >= p->js_subband_start * 2) {\n            vlc_index -= p->js_subband_start;\n        } else {\n            vlc_index /= 2;\n            if (vlc_index < 1)\n                vlc_index = 1;\n        }\n        if (vlc_index > 13)\n            vlc_index = 13;\n        j = bitstream_read_vlc(&q->bc, q->envelope_quant_index[vlc_index - 1].table,\n                               q->envelope_quant_index[vlc_index - 1].bits, 2);\n        quant_index_table[i] = quant_index_table[i - 1] + j - 12;\n        if (quant_index_table[i] > 63 || quant_index_table[i] < -63) {\n            av_log(q->avctx, AV_LOG_ERROR,\n                   "Invalid quantizer %d at position %d, outside [-63, 63] range\\n",\n                   quant_index_table[i], i);\n            return AVERROR_INVALIDDATA;\n        }\n    }\n    return 0;\n}', 'static inline uint32_t bitstream_read(BitstreamContext *bc, unsigned n)\n{\n    if (!n)\n        return 0;\n    if (n > bc->bits_left) {\n        refill_32(bc);\n        if (bc->bits_left < 32)\n            bc->bits_left = n;\n    }\n    return get_val(bc, n);\n}']