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

libavcodec/flacdec.c:208:19: Call
206. 
207.     method_type = bitstream_read(&bc, 2);
208.     rice_order  = bitstream_read(&bc, 4);
                       ^
209. 
210.     samples   = s->blocksize >> rice_order;

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

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

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: ([1, +oo] - 4):unsigned32 by call to `bitstream_read` 
    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 int decode_residuals(FLACContext *s, int32_t *decoded, int pred_order)\n{\n    BitstreamContext bc = s->bc;\n    int i, tmp, partition, method_type, rice_order;\n    int rice_bits, rice_esc;\n    int samples;\n    method_type = bitstream_read(&bc, 2);\n    rice_order  = bitstream_read(&bc, 4);\n    samples   = s->blocksize >> rice_order;\n    rice_bits = 4 + method_type;\n    rice_esc  = (1 << rice_bits) - 1;\n    decoded += pred_order;\n    i        = pred_order;\n    if (method_type > 1) {\n        av_log(s->avctx, AV_LOG_ERROR, "illegal residual coding method %d\\n",\n               method_type);\n        return AVERROR_INVALIDDATA;\n    }\n    if (pred_order > samples) {\n        av_log(s->avctx, AV_LOG_ERROR, "invalid predictor order: %i > %i\\n",\n               pred_order, samples);\n        return AVERROR_INVALIDDATA;\n    }\n    for (partition = 0; partition < (1 << rice_order); partition++) {\n        tmp = bitstream_read(&bc, rice_bits);\n        if (tmp == rice_esc) {\n            tmp = bitstream_read(&bc, 5);\n            for (; i < samples; i++)\n                *decoded++ = bitstream_read_signed(&bc, tmp);\n        } else {\n            for (; i < samples; i++) {\n                *decoded++ = get_sr_golomb_flac(&bc, tmp, INT_MAX, 0);\n            }\n        }\n        i= 0;\n    }\n    s->bc = bc;\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}']