libavcodec/wmaprodec.c:842: error: Integer Overflow L2
  ([-2, +oo] - 1):unsigned32 by call to `ff_wma_get_large_val`.

libavcodec/wmaprodec.c:833:15: Call
831.         unsigned int idx;
832. 
833.         idx = bitstream_read_vlc(&s->bc, vec4_vlc.table, VLCBITS, VEC4MAXDEPTH);
                   ^
834. 
835.         if (idx == HUFF_VEC4_SIZE - 1) {

libavcodec/bitstream.h:313:1: Parameter `(*table)[*]`
  311.  * If the VLC code is invalid and max_depth > 1, then the number of bits removed
  312.  * is undefined. */
  313. static inline int bitstream_read_vlc(BitstreamContext *bc, VLC_TYPE (*table)[2],
       ^
  314.                                      int bits, int max_depth)
  315. {

libavcodec/wmaprodec.c:833:15: Call
831.         unsigned int idx;
832. 
833.         idx = bitstream_read_vlc(&s->bc, vec4_vlc.table, VLCBITS, VEC4MAXDEPTH);
                   ^
834. 
835.         if (idx == HUFF_VEC4_SIZE - 1) {

libavcodec/bitstream.h:313:1: Parameter `(*table)[*]`
  311.  * If the VLC code is invalid and max_depth > 1, then the number of bits removed
  312.  * is undefined. */
  313. static inline int bitstream_read_vlc(BitstreamContext *bc, VLC_TYPE (*table)[2],
       ^
  314.                                      int bits, int max_depth)
  315. {

libavcodec/wmaprodec.c:837:23: Call
835.         if (idx == HUFF_VEC4_SIZE - 1) {
836.             for (i = 0; i < 4; i += 2) {
837.                 idx = bitstream_read_vlc(&s->bc, vec2_vlc.table, VLCBITS, VEC2MAXDEPTH);
                           ^
838.                 if (idx == HUFF_VEC2_SIZE - 1) {
839.                     uint32_t v0, v1;

libavcodec/bitstream.h:313:1: Parameter `(*table)[*]`
  311.  * If the VLC code is invalid and max_depth > 1, then the number of bits removed
  312.  * is undefined. */
  313. static inline int bitstream_read_vlc(BitstreamContext *bc, VLC_TYPE (*table)[2],
       ^
  314.                                      int bits, int max_depth)
  315. {

libavcodec/wmaprodec.c:840:26: Call
838.                 if (idx == HUFF_VEC2_SIZE - 1) {
839.                     uint32_t v0, v1;
840.                     v0 = bitstream_read_vlc(&s->bc, vec1_vlc.table, VLCBITS, VEC1MAXDEPTH);
                              ^
841.                     if (v0 == HUFF_VEC1_SIZE - 1)
842.                         v0 += ff_wma_get_large_val(&s->bc);

libavcodec/bitstream.h:313:1: Parameter `(*table)[*]`
  311.  * If the VLC code is invalid and max_depth > 1, then the number of bits removed
  312.  * is undefined. */
  313. static inline int bitstream_read_vlc(BitstreamContext *bc, VLC_TYPE (*table)[2],
       ^
  314.                                      int bits, int max_depth)
  315. {

libavcodec/bitstream.h:319:5: Assignment
  317.     unsigned idx = bitstream_peek(bc, bits);
  318.     int code = table[idx][0];
  319.     int n    = table[idx][1];
           ^
  320. 
  321.     if (max_depth > 1 && n < 0) {

libavcodec/bitstream.h:329:5: Call
  327.         }
  328.     }
  329.     skip_remaining(bc, n);
           ^
  330. 
  331.     return code;

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/wmaprodec.c:842:31: Call
840.                     v0 = bitstream_read_vlc(&s->bc, vec1_vlc.table, VLCBITS, VEC1MAXDEPTH);
841.                     if (v0 == HUFF_VEC1_SIZE - 1)
842.                         v0 += ff_wma_get_large_val(&s->bc);
                                   ^
843.                     v1 = bitstream_read_vlc(&s->bc, vec1_vlc.table, VLCBITS, VEC1MAXDEPTH);
844.                     if (v1 == HUFF_VEC1_SIZE - 1)

libavcodec/wma.c:389:1: Parameter `bc->bits_left`
  387.  * @return the decoded coefficient
  388.  */
  389. unsigned int ff_wma_get_large_val(BitstreamContext *bc)
       ^
  390. {
  391.     /** consumes up to 34 bits */

libavcodec/wma.c:394:9: Call
  392.     int n_bits = 8;
  393.     /** decode length */
  394.     if (bitstream_read_bit(bc)) {
               ^
  395.         n_bits += 8;
  396.         if (bitstream_read_bit(bc)) {

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: 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: Assignment
      137.     bc->bits <<= n;
      138. #endif
      139.     bc->bits_left -= n;
               ^
      140. 
      141.     return ret;

libavcodec/wma.c:396:13: Call
  394.     if (bitstream_read_bit(bc)) {
  395.         n_bits += 8;
  396.         if (bitstream_read_bit(bc)) {
                   ^
  397.             n_bits += 8;
  398.             if (bitstream_read_bit(bc))

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: 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: Assignment
      137.     bc->bits <<= n;
      138. #endif
      139.     bc->bits_left -= n;
               ^
      140. 
      141.     return ret;

libavcodec/wma.c:398:17: Call
  396.         if (bitstream_read_bit(bc)) {
  397.             n_bits += 8;
  398.             if (bitstream_read_bit(bc))
                       ^
  399.                 n_bits += 7;
  400.         }

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: ([-2, +oo] - 1):unsigned32 by call to `ff_wma_get_large_val` 
      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 decode_coeffs(WMAProDecodeCtx *s, int c)\n{\n    static const uint32_t fval_tab[16] = {\n        0x00000000, 0x3f800000, 0x40000000, 0x40400000,\n        0x40800000, 0x40a00000, 0x40c00000, 0x40e00000,\n        0x41000000, 0x41100000, 0x41200000, 0x41300000,\n        0x41400000, 0x41500000, 0x41600000, 0x41700000,\n    };\n    int vlctable;\n    VLC* vlc;\n    WMAProChannelCtx* ci = &s->channel[c];\n    int rl_mode = 0;\n    int cur_coeff = 0;\n    int num_zeros = 0;\n    const uint16_t* run;\n    const float* level;\n    ff_dlog(s->avctx, "decode coefficients for channel %i\\n", c);\n    vlctable = bitstream_read_bit(&s->bc);\n    vlc = &coef_vlc[vlctable];\n    if (vlctable) {\n        run = coef1_run;\n        level = coef1_level;\n    } else {\n        run = coef0_run;\n        level = coef0_level;\n    }\n    while ((s->transmit_num_vec_coeffs || !rl_mode) &&\n           (cur_coeff + 3 < ci->num_vec_coeffs)) {\n        uint32_t vals[4];\n        int i;\n        unsigned int idx;\n        idx = bitstream_read_vlc(&s->bc, vec4_vlc.table, VLCBITS, VEC4MAXDEPTH);\n        if (idx == HUFF_VEC4_SIZE - 1) {\n            for (i = 0; i < 4; i += 2) {\n                idx = bitstream_read_vlc(&s->bc, vec2_vlc.table, VLCBITS, VEC2MAXDEPTH);\n                if (idx == HUFF_VEC2_SIZE - 1) {\n                    uint32_t v0, v1;\n                    v0 = bitstream_read_vlc(&s->bc, vec1_vlc.table, VLCBITS, VEC1MAXDEPTH);\n                    if (v0 == HUFF_VEC1_SIZE - 1)\n                        v0 += ff_wma_get_large_val(&s->bc);\n                    v1 = bitstream_read_vlc(&s->bc, vec1_vlc.table, VLCBITS, VEC1MAXDEPTH);\n                    if (v1 == HUFF_VEC1_SIZE - 1)\n                        v1 += ff_wma_get_large_val(&s->bc);\n                    vals[i  ] = av_float2int(v0);\n                    vals[i+1] = av_float2int(v1);\n                } else {\n                    vals[i]   = fval_tab[symbol_to_vec2[idx] >> 4 ];\n                    vals[i+1] = fval_tab[symbol_to_vec2[idx] & 0xF];\n                }\n            }\n        } else {\n            vals[0] = fval_tab[ symbol_to_vec4[idx] >> 12      ];\n            vals[1] = fval_tab[(symbol_to_vec4[idx] >> 8) & 0xF];\n            vals[2] = fval_tab[(symbol_to_vec4[idx] >> 4) & 0xF];\n            vals[3] = fval_tab[ symbol_to_vec4[idx]       & 0xF];\n        }\n        for (i = 0; i < 4; i++) {\n            if (vals[i]) {\n                uint32_t sign = bitstream_read_bit(&s->bc) - 1;\n                AV_WN32A(&ci->coeffs[cur_coeff], vals[i] ^ sign << 31);\n                num_zeros = 0;\n            } else {\n                ci->coeffs[cur_coeff] = 0;\n                rl_mode |= (++num_zeros > s->subframe_len >> 8);\n            }\n            ++cur_coeff;\n        }\n    }\n    if (cur_coeff < s->subframe_len) {\n        memset(&ci->coeffs[cur_coeff], 0,\n               sizeof(*ci->coeffs) * (s->subframe_len - cur_coeff));\n        if (ff_wma_run_level_decode(s->avctx, &s->bc, vlc,\n                                    level, run, 1, ci->coeffs,\n                                    cur_coeff, s->subframe_len,\n                                    s->subframe_len, s->esc_len, 0))\n            return AVERROR_INVALIDDATA;\n    }\n    return 0;\n}', 'static inline int bitstream_read_vlc(BitstreamContext *bc, VLC_TYPE (*table)[2],\n                                     int bits, int max_depth)\n{\n    int nb_bits;\n    unsigned idx = bitstream_peek(bc, bits);\n    int code = table[idx][0];\n    int n    = table[idx][1];\n    if (max_depth > 1 && n < 0) {\n        skip_remaining(bc, bits);\n        code = set_idx(bc, code, &n, &nb_bits, table);\n        if (max_depth > 2 && n < 0) {\n            skip_remaining(bc, nb_bits);\n            code = set_idx(bc, code, &n, &nb_bits, table);\n        }\n    }\n    skip_remaining(bc, n);\n    return code;\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}', 'unsigned int ff_wma_get_large_val(BitstreamContext *bc)\n{\n    int n_bits = 8;\n    if (bitstream_read_bit(bc)) {\n        n_bits += 8;\n        if (bitstream_read_bit(bc)) {\n            n_bits += 8;\n            if (bitstream_read_bit(bc))\n                n_bits += 7;\n        }\n    }\n    return bitstream_read(bc, n_bits);\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}']