libavcodec/mpc7.c:93: error: Integer Overflow L2
  ([0, +oo] - 1):unsigned32 by call to `bitstream_read_bit`.

libavcodec/mpc7.c:92:5: Call
90.         return -1;
91.     }
92.     bitstream_skip(&bc, 88);
        ^
93.     c->gapless      = bitstream_read_bit(&bc);
94.     c->lastframelen = bitstream_read(&bc, 11);

libavcodec/bitstream.h:247:9: Assignment
  245.         n -= bc->bits_left;
  246.         bc->bits      = 0;
  247.         bc->bits_left = 0;
               ^
  248. 
  249.         if (n >= 64) {

libavcodec/bitstream.h:255:9: Call
  253.             bc->ptr += skip;
  254.         }
  255.         refill_64(bc);
               ^
  256.         if (n)
  257.             skip_remaining(bc, n);

libavcodec/bitstream.h:45:1: Parameter `bc->bits_left`
    43. } BitstreamContext;
    44. 
    45. static inline void refill_64(BitstreamContext *bc)
        ^
    46. {
    47.     if (bc->ptr >= bc->buffer_end)

libavcodec/mpc7.c:93:23: Call
91.     }
92.     bitstream_skip(&bc, 88);
93.     c->gapless      = bitstream_read_bit(&bc);
                          ^
94.     c->lastframelen = bitstream_read(&bc, 11);
95.     av_log(avctx, AV_LOG_DEBUG, "IS: %d, MSS: %d, TG: %d, LFL: %d, bands: %d\n",

libavcodec/bitstream.h:144:1: Parameter `bc->bits_left`
  142. 
  143. /* Return one bit from the buffer. */
  144. static inline unsigned bitstream_read_bit(BitstreamContext *bc)
       ^
  145. {
  146.     if (!bc->bits_left)

libavcodec/bitstream.h:149:12: Call
  147.         refill_64(bc);
  148. 
  149.     return get_val(bc, 1);
                  ^
  150. }
  151. 

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

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

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

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

libavcodec/bitstream.h:138:5: Binary operation: ([0, +oo] - 1):unsigned32 by call to `bitstream_read_bit` 
    136.     bc->bits <<= n;
    137. #endif
    138.     bc->bits_left -= n;
             ^
    139. 
    140.     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 av_cold int mpc7_decode_init(AVCodecContext * avctx)\n{\n    int i, j;\n    MPCContext *c = avctx->priv_data;\n    BitstreamContext bc;\n    LOCAL_ALIGNED_16(uint8_t, buf, [16]);\n    static int vlc_initialized = 0;\n    static VLC_TYPE scfi_table[1 << MPC7_SCFI_BITS][2];\n    static VLC_TYPE dscf_table[1 << MPC7_DSCF_BITS][2];\n    static VLC_TYPE hdr_table[1 << MPC7_HDR_BITS][2];\n    static VLC_TYPE quant_tables[7224][2];\n    if (avctx->channels != 2) {\n        avpriv_request_sample(avctx, "%d channels", avctx->channels);\n        return AVERROR_PATCHWELCOME;\n    }\n    if(avctx->extradata_size < 16){\n        av_log(avctx, AV_LOG_ERROR, "Too small extradata size (%i)!\\n", avctx->extradata_size);\n        return -1;\n    }\n    memset(c->oldDSCF, 0, sizeof(c->oldDSCF));\n    av_lfg_init(&c->rnd, 0xDEADBEEF);\n    ff_bswapdsp_init(&c->bdsp);\n    ff_mpadsp_init(&c->mpadsp);\n    c->bdsp.bswap_buf((uint32_t *) buf, (const uint32_t *) avctx->extradata, 4);\n    ff_mpc_init();\n    bitstream_init(&bc, buf, 128);\n    c->IS       = bitstream_read_bit(&bc);\n    c->MSS      = bitstream_read_bit(&bc);\n    c->maxbands = bitstream_read(&bc, 6);\n    if(c->maxbands >= BANDS){\n        av_log(avctx, AV_LOG_ERROR, "Too many bands: %i\\n", c->maxbands);\n        return -1;\n    }\n    bitstream_skip(&bc, 88);\n    c->gapless      = bitstream_read_bit(&bc);\n    c->lastframelen = bitstream_read(&bc, 11);\n    av_log(avctx, AV_LOG_DEBUG, "IS: %d, MSS: %d, TG: %d, LFL: %d, bands: %d\\n",\n            c->IS, c->MSS, c->gapless, c->lastframelen, c->maxbands);\n    c->frames_to_skip = 0;\n    avctx->sample_fmt = AV_SAMPLE_FMT_S16P;\n    avctx->channel_layout = AV_CH_LAYOUT_STEREO;\n    if(vlc_initialized) return 0;\n    av_log(avctx, AV_LOG_DEBUG, "Initing VLC\\n");\n    scfi_vlc.table = scfi_table;\n    scfi_vlc.table_allocated = 1 << MPC7_SCFI_BITS;\n    if(init_vlc(&scfi_vlc, MPC7_SCFI_BITS, MPC7_SCFI_SIZE,\n                &mpc7_scfi[1], 2, 1,\n                &mpc7_scfi[0], 2, 1, INIT_VLC_USE_NEW_STATIC)){\n        av_log(avctx, AV_LOG_ERROR, "Cannot init SCFI VLC\\n");\n        return -1;\n    }\n    dscf_vlc.table = dscf_table;\n    dscf_vlc.table_allocated = 1 << MPC7_DSCF_BITS;\n    if(init_vlc(&dscf_vlc, MPC7_DSCF_BITS, MPC7_DSCF_SIZE,\n                &mpc7_dscf[1], 2, 1,\n                &mpc7_dscf[0], 2, 1, INIT_VLC_USE_NEW_STATIC)){\n        av_log(avctx, AV_LOG_ERROR, "Cannot init DSCF VLC\\n");\n        return -1;\n    }\n    hdr_vlc.table = hdr_table;\n    hdr_vlc.table_allocated = 1 << MPC7_HDR_BITS;\n    if(init_vlc(&hdr_vlc, MPC7_HDR_BITS, MPC7_HDR_SIZE,\n                &mpc7_hdr[1], 2, 1,\n                &mpc7_hdr[0], 2, 1, INIT_VLC_USE_NEW_STATIC)){\n        av_log(avctx, AV_LOG_ERROR, "Cannot init HDR VLC\\n");\n        return -1;\n    }\n    for(i = 0; i < MPC7_QUANT_VLC_TABLES; i++){\n        for(j = 0; j < 2; j++){\n            quant_vlc[i][j].table = &quant_tables[quant_offsets[i*2 + j]];\n            quant_vlc[i][j].table_allocated = quant_offsets[i*2 + j + 1] - quant_offsets[i*2 + j];\n            if(init_vlc(&quant_vlc[i][j], 9, mpc7_quant_vlc_sizes[i],\n                        &mpc7_quant_vlc[i][j][1], 4, 2,\n                        &mpc7_quant_vlc[i][j][0], 4, 2, INIT_VLC_USE_NEW_STATIC)){\n                av_log(avctx, AV_LOG_ERROR, "Cannot init QUANT VLC %i,%i\\n",i,j);\n                return -1;\n            }\n        }\n    }\n    vlc_initialized = 1;\n    return 0;\n}', 'static inline void bitstream_skip(BitstreamContext *bc, unsigned n)\n{\n    if (n < bc->bits_left)\n        skip_remaining(bc, n);\n    else {\n        n -= bc->bits_left;\n        bc->bits      = 0;\n        bc->bits_left = 0;\n        if (n >= 64) {\n            unsigned skip = n / 8;\n            n -= skip * 8;\n            bc->ptr += skip;\n        }\n        refill_64(bc);\n        if (n)\n            skip_remaining(bc, n);\n    }\n}', 'static inline void refill_64(BitstreamContext *bc)\n{\n    if (bc->ptr >= bc->buffer_end)\n        return;\n#ifdef BITSTREAM_READER_LE\n    bc->bits       = AV_RL64(bc->ptr);\n#else\n    bc->bits       = AV_RB64(bc->ptr);\n#endif\n    bc->ptr       += 8;\n    bc->bits_left  = 64;\n}', 'static inline unsigned bitstream_read_bit(BitstreamContext *bc)\n{\n    if (!bc->bits_left)\n        refill_64(bc);\n    return get_val(bc, 1);\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}']