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

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

libavcodec/bitstream.h:241:1: Parameter `n`
  239. 
  240. /* Skip n bits in the buffer. */
  241. static inline void bitstream_skip(BitstreamContext *bc, unsigned n)
       ^
  242. {
  243.     if (n <= bc->bits_left)

libavcodec/bitstream.h:244:9: Call
  242. {
  243.     if (n <= bc->bits_left)
  244.         skip_remaining(bc, n);
               ^
  245.     else {
  246.         n -= bc->bits_left;

libavcodec/bitstream.h:230:1: Parameter `n`
    228. }
    229. 
    230. static inline void skip_remaining(BitstreamContext *bc, unsigned n)
         ^
    231. {
    232. #ifdef BITSTREAM_READER_LE

libavcodec/bitstream.h:237:5: Assignment
    235.     bc->bits <<= n;
    236. #endif
    237.     bc->bits_left -= n;
             ^
    238. }
    239. 

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

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

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

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: ([0, +oo] - 1):unsigned32 by call to `bitstream_read_bit` 
    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 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        skip_remaining(bc, bc->bits_left);\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 skip_remaining(BitstreamContext *bc, unsigned n)\n{\n#ifdef BITSTREAM_READER_LE\n    bc->bits >>= n;\n#else\n    bc->bits <<= n;\n#endif\n    bc->bits_left -= n;\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}']