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

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

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

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

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

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

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

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

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

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

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

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: Binary operation: ([0, +oo] - 4):unsigned32 by call to `parse_packet_header` 
      235.     bc->bits <<= n;
      236. #endif
      237.     bc->bits_left -= n;
               ^
      238. }
      239. 

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        skip_remaining(bc, bc->bits_left);\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}']