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

libavcodec/flac.c:222:24: Call
220.     s->max_framesize = bitstream_read(&bc, 24);
221.     s->samplerate    = bitstream_read(&bc, 20);
222.     s->channels      = bitstream_read(&bc, 3) + 1;
                            ^
223.     s->bps           = bitstream_read(&bc, 5) + 1;
224. 

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] - 3):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;
}
['void ff_flac_parse_streaminfo(AVCodecContext *avctx, struct FLACStreaminfo *s,\n                              const uint8_t *buffer)\n{\n    BitstreamContext bc;\n    bitstream_init8(&bc, buffer, FLAC_STREAMINFO_SIZE);\n    bitstream_skip(&bc, 16);\n    s->max_blocksize = bitstream_read(&bc, 16);\n    if (s->max_blocksize < FLAC_MIN_BLOCKSIZE) {\n        av_log(avctx, AV_LOG_WARNING, "invalid max blocksize: %d\\n",\n               s->max_blocksize);\n        s->max_blocksize = 16;\n    }\n    bitstream_skip(&bc, 24);\n    s->max_framesize = bitstream_read(&bc, 24);\n    s->samplerate    = bitstream_read(&bc, 20);\n    s->channels      = bitstream_read(&bc, 3) + 1;\n    s->bps           = bitstream_read(&bc, 5) + 1;\n    avctx->channels = s->channels;\n    avctx->sample_rate = s->samplerate;\n    avctx->bits_per_raw_sample = s->bps;\n    if (!avctx->channel_layout ||\n        av_get_channel_layout_nb_channels(avctx->channel_layout) != avctx->channels)\n        ff_flac_set_channel_layout(avctx);\n    s->samples  = bitstream_read(&bc, 32) << 4;\n    s->samples |= bitstream_read(&bc, 4);\n    bitstream_skip(&bc, 64);\n    bitstream_skip(&bc, 64);\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}']