libavcodec/lagarith.c:130: error: Integer Overflow L2
  (32 - [0, max(63, `bc->bits_left`)]):unsigned32 by call to `bitstream_read`.

libavcodec/lagarith.c:104:1: Parameter `bc->bits_left`
102. }
103. 
104. static int lag_decode_prob(BitstreamContext *bc, uint32_t *value)
     ^
105. {
106.     static const uint8_t series[] = { 1, 2, 3, 5, 8, 13, 21 };

libavcodec/lagarith.c:130:12: Call
128.     }
129. 
130.     val  = bitstream_read(bc, bits);
                ^
131.     val |= 1 << bits;
132. 

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, max(63, bc->bits_left)]):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 lag_decode_prob(BitstreamContext *bc, uint32_t *value)\n{\n    static const uint8_t series[] = { 1, 2, 3, 5, 8, 13, 21 };\n    int i;\n    int bit     = 0;\n    int bits    = 0;\n    int prevbit = 0;\n    unsigned val;\n    for (i = 0; i < 7; i++) {\n        if (prevbit && bit)\n            break;\n        prevbit = bit;\n        bit = bitstream_read_bit(bc);\n        if (bit && !prevbit)\n            bits += series[i];\n    }\n    bits--;\n    if (bits < 0 || bits > 31) {\n        *value = 0;\n        return -1;\n    } else if (bits == 0) {\n        *value = 0;\n        return 0;\n    }\n    val  = bitstream_read(bc, bits);\n    val |= 1 << bits;\n    *value = val - 1;\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}']