libavcodec/wmavoice.c:1972: error: Integer Overflow L2
  ([0, +oo] - 4):unsigned32 by call to `parse_packet_header`.

libavcodec/wmavoice.c:1966:5: Call
1964.         return 0;
1965.     }
1966.     bitstream_init8(&s->bc, avpkt->data, size);
          ^
1967. 
1968.     /* size == ctx->block_align is used to indicate whether we are dealing with

libavcodec/bitstream.h:103:1: Parameter `bc->bits_left`
  101. 
  102. /* Initialize BitstreamContext with buffer size in bytes instead of bits. */
  103. static inline int bitstream_init8(BitstreamContext *bc, const uint8_t *buffer,
       ^
  104.                                   unsigned byte_size)
  105. {

libavcodec/wmavoice.c:1972:20: Call
1970.      * previously. */
1971.     if (size == ctx->block_align) { // new packet header
1972.         if ((res = parse_packet_header(s)) < 0)
                         ^
1973.             return res;
1974. 

libavcodec/wmavoice.c:1885:1: Parameter `s->bc.bits_left`
  1883.  * @return 1 if not enough bits were available, or 0 on success.
  1884.  */
  1885. static int parse_packet_header(WMAVoiceContext *s)
        ^
  1886. {
  1887.     BitstreamContext *bc = &s->bc;

libavcodec/wmavoice.c:1892:5: Call
  1890.     if (bitstream_bits_left(bc) < 11)
  1891.         return 1;
  1892.     bitstream_skip(bc, 4);      // packet sequence number
            ^
  1893.     s->has_residual_lsps = bitstream_read_bit(bc);
  1894.     do {

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

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

libavcodec/bitstream.h:229:1: <LHS trace>
227. }
228. 
229. static inline void skip_remaining(BitstreamContext *bc, unsigned n)
     ^
230. {
231. #ifdef BITSTREAM_READER_LE

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

libavcodec/bitstream.h:229:1: <RHS trace>
227. }
228. 
229. static inline void skip_remaining(BitstreamContext *bc, unsigned n)
     ^
230. {
231. #ifdef BITSTREAM_READER_LE

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

libavcodec/bitstream.h:236:5: Binary operation: ([0, +oo] - 4):unsigned32 by call to `parse_packet_header` 
      234.     bc->bits <<= n;
      235. #endif
      236.     bc->bits_left -= n;
               ^
      237. }
      238. 

static inline void skip_remaining(BitstreamContext *bc, unsigned n)
{
#ifdef BITSTREAM_READER_LE
    bc->bits >>= n;
#else
    bc->bits <<= n;
#endif
    bc->bits_left -= n;
}
['static int wmavoice_decode_packet(AVCodecContext *ctx, void *data,\n                                  int *got_frame_ptr, AVPacket *avpkt)\n{\n    WMAVoiceContext *s = ctx->priv_data;\n    BitstreamContext *bc = &s->bc;\n    int size, res, pos;\n    for (size = avpkt->size; size > ctx->block_align; size -= ctx->block_align);\n    if (!size) {\n        *got_frame_ptr = 0;\n        return 0;\n    }\n    bitstream_init8(&s->bc, avpkt->data, size);\n    if (size == ctx->block_align) {\n        if ((res = parse_packet_header(s)) < 0)\n            return res;\n        if (s->spillover_nbits > 0) {\n            if (s->sframe_cache_size > 0) {\n                int cnt = bitstream_tell(bc);\n                copy_bits(&s->pb, avpkt->data, size, bc, s->spillover_nbits);\n                flush_put_bits(&s->pb);\n                s->sframe_cache_size += s->spillover_nbits;\n                if ((res = synth_superframe(ctx, data, got_frame_ptr)) == 0 &&\n                    *got_frame_ptr) {\n                    cnt += s->spillover_nbits;\n                    s->skip_bits_next = cnt & 7;\n                    return cnt >> 3;\n                } else\n                    bitstream_skip (bc, s->spillover_nbits - cnt +\n                                    bitstream_tell(bc));\n            } else\n                bitstream_skip(bc, s->spillover_nbits);\n        }\n    } else if (s->skip_bits_next)\n        bitstream_skip(bc, s->skip_bits_next);\n    s->sframe_cache_size = 0;\n    s->skip_bits_next = 0;\n    pos = bitstream_bits_left(bc);\n    if ((res = synth_superframe(ctx, data, got_frame_ptr)) < 0) {\n        return res;\n    } else if (*got_frame_ptr) {\n        int cnt = bitstream_tell(bc);\n        s->skip_bits_next = cnt & 7;\n        return cnt >> 3;\n    } else if ((s->sframe_cache_size = pos) > 0) {\n        bitstream_init8(bc, avpkt->data, size);\n        bitstream_skip(bc, (size << 3) - pos);\n        assert(bitstream_bits_left(bc) == pos);\n        init_put_bits(&s->pb, s->sframe_cache, SFRAME_CACHE_MAXSIZE);\n        copy_bits(&s->pb, avpkt->data, size, bc, s->sframe_cache_size);\n    }\n    return size;\n}', 'static inline int bitstream_init8(BitstreamContext *bc, const uint8_t *buffer,\n                                  unsigned byte_size)\n{\n    if (byte_size > INT_MAX / 8)\n        return AVERROR_INVALIDDATA;\n    return bitstream_init(bc, buffer, byte_size * 8);\n}', 'static int parse_packet_header(WMAVoiceContext *s)\n{\n    BitstreamContext *bc = &s->bc;\n    unsigned int res;\n    if (bitstream_bits_left(bc) < 11)\n        return 1;\n    bitstream_skip(bc, 4);\n    s->has_residual_lsps = bitstream_read_bit(bc);\n    do {\n        res = bitstream_read(bc, 6);\n        if (bitstream_bits_left(bc) < 6 * (res == 0x3F) + s->spillover_bitsize)\n            return 1;\n    } while (res == 0x3F);\n    s->spillover_nbits = bitstream_read(bc, s->spillover_bitsize);\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        bc->bits      = 0;\n        bc->bits_left = 0;\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}']