libavcodec/wmaprodec.c:1541: error: Integer Overflow L2
  (32 - [0, 64]):unsigned32 by call to `bitstream_read`.

libavcodec/wmaprodec.c:1540:9: Call
1538. 
1539.         /** parse packet header */
1540.         bitstream_init(bc, buf, s->buf_bit_size);
              ^
1541.         packet_sequence_number = bitstream_read(bc, 4);
1542.         bitstream_skip(bc, 2);

libavcodec/bitstream.h:85:9: Assignment
  83.         bc->buffer    =
  84.         bc->ptr       = NULL;
  85.         bc->bits_left = 0;
              ^
  86.         return AVERROR_INVALIDDATA;
  87.     }

libavcodec/wmaprodec.c:1541:34: Call
1539.         /** parse packet header */
1540.         bitstream_init(bc, buf, s->buf_bit_size);
1541.         packet_sequence_number = bitstream_read(bc, 4);
                                       ^
1542.         bitstream_skip(bc, 2);
1543. 

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:189:9: Call
  187. 
  188.     if (n > bc->bits_left) {
  189.         refill_32(bc);
               ^
  190.         if (bc->bits_left < 32)
  191.             bc->bits_left = n;

libavcodec/bitstream.h:60:1: <RHS trace>
58. }
59. 
60. static inline void refill_32(BitstreamContext *bc)
    ^
61. {
62.     if (bc->ptr >= bc->buffer_end)

libavcodec/bitstream.h:60:1: Parameter `bc->bits_left`
    58. }
    59. 
    60. static inline void refill_32(BitstreamContext *bc)
        ^
    61. {
    62.     if (bc->ptr >= bc->buffer_end)

libavcodec/bitstream.h:68:5: Binary operation: (32 - [0, 64]):unsigned32 by call to `bitstream_read` 
    66.     bc->bits       = (uint64_t)AV_RL32(bc->ptr) << bc->bits_left | bc->bits;
    67. #else
    68.     bc->bits       = bc->bits | (uint64_t)AV_RB32(bc->ptr) << (32 - bc->bits_left);
            ^
    69. #endif
    70.     bc->ptr       += 4;

static inline void refill_32(BitstreamContext *bc)
{
    if (bc->ptr >= bc->buffer_end)
        return;
#ifdef BITSTREAM_READER_LE
    bc->bits       = (uint64_t)AV_RL32(bc->ptr) << bc->bits_left | bc->bits;
#else
    bc->bits       = bc->bits | (uint64_t)AV_RB32(bc->ptr) << (32 - bc->bits_left);
#endif
    bc->ptr       += 4;
    bc->bits_left += 32;
}
['static int decode_packet(AVCodecContext *avctx, void *data,\n                         int *got_frame_ptr, AVPacket* avpkt)\n{\n    WMAProDecodeCtx *s = avctx->priv_data;\n    BitstreamContext *bc = &s->pbc;\n    const uint8_t* buf = avpkt->data;\n    int buf_size       = avpkt->size;\n    int num_bits_prev_frame;\n    int packet_sequence_number;\n    *got_frame_ptr = 0;\n    if (s->packet_done || s->packet_loss) {\n        s->packet_done = 0;\n        if (buf_size < avctx->block_align) {\n            av_log(avctx, AV_LOG_ERROR, "Input packet too small (%d < %d)\\n",\n                   buf_size, avctx->block_align);\n            return AVERROR_INVALIDDATA;\n        }\n        s->next_packet_start = buf_size - avctx->block_align;\n        buf_size = avctx->block_align;\n        s->buf_bit_size = buf_size << 3;\n        bitstream_init(bc, buf, s->buf_bit_size);\n        packet_sequence_number = bitstream_read(bc, 4);\n        bitstream_skip(bc, 2);\n        num_bits_prev_frame = bitstream_read(bc, s->log2_frame_size);\n        ff_dlog(avctx, "packet[%d]: nbpf %x\\n", avctx->frame_number,\n                num_bits_prev_frame);\n        if (!s->packet_loss &&\n            ((s->packet_sequence_number + 1) & 0xF) != packet_sequence_number) {\n            s->packet_loss = 1;\n            av_log(avctx, AV_LOG_ERROR,\n                   "Packet loss detected! seq %"PRIx8" vs %x\\n",\n                   s->packet_sequence_number, packet_sequence_number);\n        }\n        s->packet_sequence_number = packet_sequence_number;\n        if (num_bits_prev_frame > 0) {\n            int remaining_packet_bits = s->buf_bit_size - bitstream_tell(bc);\n            if (num_bits_prev_frame >= remaining_packet_bits) {\n                num_bits_prev_frame = remaining_packet_bits;\n                s->packet_done = 1;\n            }\n            save_bits(s, bc, num_bits_prev_frame, 1);\n            ff_dlog(avctx, "accumulated %x bits of frame data\\n",\n                    s->num_saved_bits - s->frame_offset);\n            if (!s->packet_loss)\n                decode_frame(s, data, got_frame_ptr);\n        } else if (s->num_saved_bits - s->frame_offset) {\n            ff_dlog(avctx, "ignoring %x previously saved bits\\n",\n                    s->num_saved_bits - s->frame_offset);\n        }\n        if (s->packet_loss) {\n            s->num_saved_bits = 0;\n            s->packet_loss = 0;\n        }\n    } else {\n        int frame_size;\n        s->buf_bit_size = (avpkt->size - s->next_packet_start) << 3;\n        bitstream_init(bc, avpkt->data, s->buf_bit_size);\n        bitstream_skip(bc, s->packet_offset);\n        if (s->len_prefix && remaining_bits(s, bc) > s->log2_frame_size &&\n            (frame_size = bitstream_peek(bc, s->log2_frame_size)) &&\n            frame_size <= remaining_bits(s, bc)) {\n            save_bits(s, bc, frame_size, 0);\n            s->packet_done = !decode_frame(s, data, got_frame_ptr);\n        } else if (!s->len_prefix\n                   && s->num_saved_bits > bitstream_tell(&s->bc)) {\n            s->packet_done = !decode_frame(s, data, got_frame_ptr);\n        } else\n            s->packet_done = 1;\n    }\n    if (s->packet_done && !s->packet_loss &&\n        remaining_bits(s, bc) > 0) {\n        save_bits(s, bc, remaining_bits(s, bc), 0);\n    }\n    s->packet_offset = bitstream_tell(bc) & 7;\n    if (s->packet_loss)\n        return AVERROR_INVALIDDATA;\n    return bitstream_tell(bc) >> 3;\n}', 'static inline int bitstream_init(BitstreamContext *bc, const uint8_t *buffer,\n                                 unsigned bit_size)\n{\n    unsigned buffer_size;\n    if (bit_size > INT_MAX - 7 || !buffer) {\n        buffer        =\n        bc->buffer    =\n        bc->ptr       = NULL;\n        bc->bits_left = 0;\n        return AVERROR_INVALIDDATA;\n    }\n    buffer_size = (bit_size + 7) >> 3;\n    bc->buffer       = buffer;\n    bc->buffer_end   = buffer + buffer_size;\n    bc->ptr          = bc->buffer;\n    bc->size_in_bits = bit_size;\n    bc->bits_left    = 0;\n    bc->bits         = 0;\n    refill_64(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 void refill_32(BitstreamContext *bc)\n{\n    if (bc->ptr >= bc->buffer_end)\n        return;\n#ifdef BITSTREAM_READER_LE\n    bc->bits       = (uint64_t)AV_RL32(bc->ptr) << bc->bits_left | bc->bits;\n#else\n    bc->bits       = bc->bits | (uint64_t)AV_RB32(bc->ptr) << (32 - bc->bits_left);\n#endif\n    bc->ptr       += 4;\n    bc->bits_left += 32;\n}']