libavcodec/mpc8.c:330: error: Integer Overflow L2
  ([1, +oo] - 6):unsigned32 by call to `bitstream_read`.

libavcodec/mpc8.c:330:26: Call
328.                 t = bitstream_read_vlc(bc, dscf_vlc[1].table, MPC8_DSCF1_BITS, 2);
329.                 if(t == 64)
330.                     t += bitstream_read(bc, 6);
                              ^
331.                 bands[i].scf_idx[ch][0] = ((bands[i].scf_idx[ch][2] + t - 25) & 0x7F) - 6;
332.             }

libavcodec/bitstream.h:183:1: Parameter `n`
  181. 
  182. /* Return n bits from the buffer. n has to be in the 0-32 range. */
  183. static inline uint32_t bitstream_read(BitstreamContext *bc, unsigned n)
       ^
  184. {
  185.     if (!n)

libavcodec/bitstream.h:194:12: Call
  192.     }
  193. 
  194.     return get_val(bc, n);
                  ^
  195. }
  196. 

libavcodec/bitstream.h:130:1: <LHS trace>
128. }
129. 
130. static inline uint64_t get_val(BitstreamContext *bc, unsigned n)
     ^
131. {
132. #ifdef BITSTREAM_READER_LE

libavcodec/bitstream.h:130:1: Parameter `bc->bits_left`
    128. }
    129. 
    130. static inline uint64_t get_val(BitstreamContext *bc, unsigned n)
         ^
    131. {
    132. #ifdef BITSTREAM_READER_LE

libavcodec/bitstream.h:130:1: <RHS trace>
128. }
129. 
130. static inline uint64_t get_val(BitstreamContext *bc, unsigned n)
     ^
131. {
132. #ifdef BITSTREAM_READER_LE

libavcodec/bitstream.h:130:1: Parameter `n`
    128. }
    129. 
    130. static inline uint64_t get_val(BitstreamContext *bc, unsigned n)
         ^
    131. {
    132. #ifdef BITSTREAM_READER_LE

libavcodec/bitstream.h:139:5: Binary operation: ([1, +oo] - 6):unsigned32 by call to `bitstream_read` 
    137.     bc->bits <<= n;
    138. #endif
    139.     bc->bits_left -= n;
             ^
    140. 
    141.     return ret;

static inline uint64_t get_val(BitstreamContext *bc, unsigned n)
{
#ifdef BITSTREAM_READER_LE
    uint64_t ret = bc->bits & ((UINT64_C(1) << n) - 1);
    bc->bits >>= n;
#else
    uint64_t ret = bc->bits >> (64 - n);
    bc->bits <<= n;
#endif
    bc->bits_left -= n;
    return ret;
}
['static int mpc8_decode_frame(AVCodecContext * avctx, void *data,\n                             int *got_frame_ptr, AVPacket *avpkt)\n{\n    AVFrame *frame     = data;\n    const uint8_t *buf = avpkt->data;\n    int buf_size = avpkt->size;\n    MPCContext *c = avctx->priv_data;\n    BitstreamContext bc2, *bc = &bc2;\n    int i, j, k, ch, cnt, res, t;\n    Band *bands = c->bands;\n    int off;\n    int maxband, keyframe;\n    int last[2];\n    frame->nb_samples = MPC_FRAME_SIZE;\n    if ((res = ff_get_buffer(avctx, frame, 0)) < 0) {\n        av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\\n");\n        return res;\n    }\n    keyframe = c->cur_frame == 0;\n    if(keyframe){\n        memset(c->Q, 0, sizeof(c->Q));\n        c->last_bits_used = 0;\n    }\n    bitstream_init(bc, buf, buf_size * 8);\n    bitstream_skip(bc, c->last_bits_used & 7);\n    if(keyframe)\n        maxband = mpc8_get_mod_golomb(bc, c->maxbands + 1);\n    else{\n        maxband = c->last_max_band + bitstream_read_vlc(bc, band_vlc.table, MPC8_BANDS_BITS, 2);\n        if(maxband > 32) maxband -= 33;\n    }\n    if(maxband > c->maxbands + 1)\n        return AVERROR_INVALIDDATA;\n    c->last_max_band = maxband;\n    if(maxband){\n        last[0] = last[1] = 0;\n        for(i = maxband - 1; i >= 0; i--){\n            for(ch = 0; ch < 2; ch++){\n                last[ch] = bitstream_read_vlc(bc, res_vlc[last[ch] > 2].table, MPC8_RES_BITS, 2) + last[ch];\n                if(last[ch] > 15) last[ch] -= 17;\n                bands[i].res[ch] = last[ch];\n            }\n        }\n        if(c->MSS){\n            int mask;\n            cnt = 0;\n            for(i = 0; i < maxband; i++)\n                if(bands[i].res[0] || bands[i].res[1])\n                    cnt++;\n            t = mpc8_get_mod_golomb(bc, cnt);\n            mask = mpc8_get_mask(bc, cnt, t);\n            for(i = maxband - 1; i >= 0; i--)\n                if(bands[i].res[0] || bands[i].res[1]){\n                    bands[i].msf = mask & 1;\n                    mask >>= 1;\n                }\n        }\n    }\n    for(i = maxband; i < c->maxbands; i++)\n        bands[i].res[0] = bands[i].res[1] = 0;\n    if(keyframe){\n        for(i = 0; i < 32; i++)\n            c->oldDSCF[0][i] = c->oldDSCF[1][i] = 1;\n    }\n    for(i = 0; i < maxband; i++){\n        if(bands[i].res[0] || bands[i].res[1]){\n            cnt = !!bands[i].res[0] + !!bands[i].res[1] - 1;\n            if(cnt >= 0){\n                t = bitstream_read_vlc(bc, scfi_vlc[cnt].table, scfi_vlc[cnt].bits, 1);\n                if(bands[i].res[0]) bands[i].scfi[0] = t >> (2 * cnt);\n                if(bands[i].res[1]) bands[i].scfi[1] = t & 3;\n            }\n        }\n    }\n    for(i = 0; i < maxband; i++){\n        for(ch = 0; ch < 2; ch++){\n            if(!bands[i].res[ch]) continue;\n            if(c->oldDSCF[ch][i]){\n                bands[i].scf_idx[ch][0] = bitstream_read(bc, 7) - 6;\n                c->oldDSCF[ch][i] = 0;\n            }else{\n                t = bitstream_read_vlc(bc, dscf_vlc[1].table, MPC8_DSCF1_BITS, 2);\n                if(t == 64)\n                    t += bitstream_read(bc, 6);\n                bands[i].scf_idx[ch][0] = ((bands[i].scf_idx[ch][2] + t - 25) & 0x7F) - 6;\n            }\n            for(j = 0; j < 2; j++){\n                if((bands[i].scfi[ch] << j) & 2)\n                    bands[i].scf_idx[ch][j + 1] = bands[i].scf_idx[ch][j];\n                else{\n                    t = bitstream_read_vlc(bc, dscf_vlc[0].table, MPC8_DSCF0_BITS, 2);\n                    if(t == 31)\n                        t = 64 + bitstream_read(bc, 6);\n                    bands[i].scf_idx[ch][j + 1] = ((bands[i].scf_idx[ch][j] + t - 25) & 0x7F) - 6;\n                }\n            }\n        }\n    }\n    for(i = 0, off = 0; i < maxband; i++, off += SAMPLES_PER_BAND){\n        for(ch = 0; ch < 2; ch++){\n            res = bands[i].res[ch];\n            switch(res){\n            case -1:\n                for(j = 0; j < SAMPLES_PER_BAND; j++)\n                    c->Q[ch][off + j] = (av_lfg_get(&c->rnd) & 0x3FC) - 510;\n                break;\n            case 0:\n                break;\n            case 1:\n                for(j = 0; j < SAMPLES_PER_BAND; j += SAMPLES_PER_BAND / 2){\n                    cnt = bitstream_read_vlc(bc, q1_vlc.table, MPC8_Q1_BITS, 2);\n                    t = mpc8_get_mask(bc, 18, cnt);\n                    for(k = 0; k < SAMPLES_PER_BAND / 2; k++, t <<= 1)\n                        c->Q[ch][off + j + k] = (t & 0x20000) ? (bitstream_read_bit(bc) << 1) - 1 : 0;\n                }\n                break;\n            case 2:\n                cnt = 6;\n                for(j = 0; j < SAMPLES_PER_BAND; j += 3){\n                    t = bitstream_read_vlc(bc, q2_vlc[cnt > 3].table, MPC8_Q2_BITS, 2);\n                    c->Q[ch][off + j + 0] = mpc8_idx50[t];\n                    c->Q[ch][off + j + 1] = mpc8_idx51[t];\n                    c->Q[ch][off + j + 2] = mpc8_idx52[t];\n                    cnt = (cnt >> 1) + mpc8_huffq2[t];\n                }\n                break;\n            case 3:\n            case 4:\n                for(j = 0; j < SAMPLES_PER_BAND; j += 2){\n                    t = bitstream_read_vlc(bc, q3_vlc[res - 3].table, MPC8_Q3_BITS, 2) + q3_offsets[res - 3];\n                    c->Q[ch][off + j + 1] = t >> 4;\n                    c->Q[ch][off + j + 0] = (t & 8) ? (t & 0xF) - 16 : (t & 0xF);\n                }\n                break;\n            case 5:\n            case 6:\n            case 7:\n            case 8:\n                cnt = 2 * mpc8_thres[res];\n                for(j = 0; j < SAMPLES_PER_BAND; j++){\n                    t = bitstream_read_vlc(bc, quant_vlc[res - 5][cnt > mpc8_thres[res]].table, quant_vlc[res - 5][cnt > mpc8_thres[res]].bits, 2) + quant_offsets[res - 5];\n                    c->Q[ch][off + j] = t;\n                    cnt = (cnt >> 1) + FFABS(c->Q[ch][off + j]);\n                }\n                break;\n            default:\n                for(j = 0; j < SAMPLES_PER_BAND; j++){\n                    c->Q[ch][off + j] = bitstream_read_vlc(bc, q9up_vlc.table, MPC8_Q9UP_BITS, 2);\n                    if(res != 9){\n                        c->Q[ch][off + j] <<= res - 9;\n                        c->Q[ch][off + j] |= bitstream_read(bc, res - 9);\n                    }\n                    c->Q[ch][off + j] -= (1 << (res - 2)) - 1;\n                }\n            }\n        }\n    }\n    ff_mpc_dequantize_and_synth(c, maxband - 1,\n                                (int16_t **)frame->extended_data,\n                                avctx->channels);\n    c->cur_frame++;\n    c->last_bits_used = bitstream_tell(bc);\n    if (bitstream_bits_left(bc) < 8)\n        c->last_bits_used = buf_size << 3;\n    if(c->cur_frame >= c->frames)\n        c->cur_frame = 0;\n    *got_frame_ptr = 1;\n    return c->cur_frame ? c->last_bits_used >> 3 : buf_size;\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}', 'static inline uint64_t get_val(BitstreamContext *bc, unsigned n)\n{\n#ifdef BITSTREAM_READER_LE\n    uint64_t ret = bc->bits & ((UINT64_C(1) << n) - 1);\n    bc->bits >>= n;\n#else\n    uint64_t ret = bc->bits >> (64 - n);\n    bc->bits <<= n;\n#endif\n    bc->bits_left -= n;\n    return ret;\n}']