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

libavcodec/wmalosslessdec.c:520:43: Call
518.         }
519.         if (quo >= 32)
520.             quo += bitstream_read(&s->bc, bitstream_read(&s->bc, 5) + 1);
                                               ^
521. 
522.         ave_mean = (s->ave_sum[ch] + (1 << s->movave_scaling)) >> (s->movave_scaling + 1);

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] - 5):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 decode_channel_residues(WmallDecodeCtx *s, int ch, int tile_size)\n{\n    int i = 0;\n    unsigned int ave_mean;\n    s->transient[ch] = bitstream_read_bit(&s->bc);\n    if (s->transient[ch]) {\n        s->transient_pos[ch] = bitstream_read(&s->bc, av_log2(tile_size));\n        if (s->transient_pos[ch])\n            s->transient[ch] = 0;\n        s->channel[ch].transient_counter =\n            FFMAX(s->channel[ch].transient_counter, s->samples_per_frame / 2);\n    } else if (s->channel[ch].transient_counter)\n        s->transient[ch] = 1;\n    if (s->seekable_tile) {\n        ave_mean = bitstream_read(&s->bc, s->bits_per_sample);\n        s->ave_sum[ch] = ave_mean << (s->movave_scaling + 1);\n    }\n    if (s->seekable_tile) {\n        if (s->do_inter_ch_decorr)\n            s->channel_residues[ch][0] = bitstream_read_signed(&s->bc, s->bits_per_sample + 1);\n        else\n            s->channel_residues[ch][0] = bitstream_read_signed(&s->bc, s->bits_per_sample);\n        i++;\n    }\n    for (; i < tile_size; i++) {\n        int quo = 0, rem, rem_bits, residue;\n        while (bitstream_read_bit(&s->bc)) {\n            quo++;\n            if (bitstream_bits_left(&s->bc) <= 0)\n                return -1;\n        }\n        if (quo >= 32)\n            quo += bitstream_read(&s->bc, bitstream_read(&s->bc, 5) + 1);\n        ave_mean = (s->ave_sum[ch] + (1 << s->movave_scaling)) >> (s->movave_scaling + 1);\n        if (ave_mean <= 1)\n            residue = quo;\n        else {\n            rem_bits = av_ceil_log2(ave_mean);\n            rem      = rem_bits ? bitstream_read(&s->bc, rem_bits) : 0;\n            residue  = (quo << rem_bits) + rem;\n        }\n        s->ave_sum[ch] = residue + s->ave_sum[ch] -\n                         (s->ave_sum[ch] >> s->movave_scaling);\n        if (residue & 1)\n            residue = -(residue >> 1) - 1;\n        else\n            residue = residue >> 1;\n        s->channel_residues[ch][i] = residue;\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}', '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}']