libavcodec/alsdec.c:470: error: Integer Overflow L2
  ([0, max(64, `bc->bits_left`)] - 1):unsigned32 by call to `bitstream_read_bit`.

libavcodec/alsdec.c:466:1: Parameter `bc->bits_left`
464. /** Read and decode a Rice codeword.
465.  */
466. static int32_t decode_rice(BitstreamContext *bc, unsigned int k)
     ^
467. {
468.     int max = bitstream_bits_left(bc) - k;

libavcodec/alsdec.c:469:15: Call
467. {
468.     int max = bitstream_bits_left(bc) - k;
469.     int q   = get_unary(bc, 0, max);
                   ^
470.     int r   = k ? bitstream_read_bit(bc) : !(q & 1);
471. 

libavcodec/unary.h:33:1: Parameter `bc->bits_left`
  31.  * @return Unary length/index
  32.  */
  33. static inline int get_unary(BitstreamContext *bc, int stop, int len)
      ^
  34. {
  35.     int i;

libavcodec/alsdec.c:470:19: Call
468.     int max = bitstream_bits_left(bc) - k;
469.     int q   = get_unary(bc, 0, max);
470.     int r   = k ? bitstream_read_bit(bc) : !(q & 1);
                       ^
471. 
472.     if (k > 1) {

libavcodec/bitstream.h:145:1: Parameter `bc->bits_left`
  143. 
  144. /* Return one bit from the buffer. */
  145. static inline unsigned bitstream_read_bit(BitstreamContext *bc)
       ^
  146. {
  147.     if (!bc->bits_left)

libavcodec/bitstream.h:150:12: Call
  148.         refill_64(bc);
  149. 
  150.     return get_val(bc, 1);
                  ^
  151. }
  152. 

libavcodec/bitstream.h:130:1: <LHS trace>
128. }
129. 
130. static inline uint64_t get_val(BitstreamContext *bc, unsigned n)
     ^
131. {
132. #ifdef BITSTREAM_READER_LE

libavcodec/bitstream.h:130:1: Parameter `bc->bits_left`
    128. }
    129. 
    130. static inline uint64_t get_val(BitstreamContext *bc, unsigned n)
         ^
    131. {
    132. #ifdef BITSTREAM_READER_LE

libavcodec/bitstream.h:130:1: <RHS trace>
128. }
129. 
130. static inline uint64_t get_val(BitstreamContext *bc, unsigned n)
     ^
131. {
132. #ifdef BITSTREAM_READER_LE

libavcodec/bitstream.h:130:1: Parameter `n`
    128. }
    129. 
    130. static inline uint64_t get_val(BitstreamContext *bc, unsigned n)
         ^
    131. {
    132. #ifdef BITSTREAM_READER_LE

libavcodec/bitstream.h:139:5: Binary operation: ([0, max(64, bc->bits_left)] - 1):unsigned32 by call to `bitstream_read_bit` 
    137.     bc->bits <<= n;
    138. #endif
    139.     bc->bits_left -= n;
             ^
    140. 
    141.     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;
}
['static int32_t decode_rice(BitstreamContext *bc, unsigned int k)\n{\n    int max = bitstream_bits_left(bc) - k;\n    int q   = get_unary(bc, 0, max);\n    int r   = k ? bitstream_read_bit(bc) : !(q & 1);\n    if (k > 1) {\n        q <<= (k - 1);\n        q  += bitstream_read(bc, k - 1);\n    } else if (!k) {\n        q >>= 1;\n    }\n    return r ? q : ~q;\n}', 'static inline int get_unary(BitstreamContext *bc, int stop, int len)\n{\n    int i;\n    for (i = 0; i < len && bitstream_read_bit(bc) != stop; i++)\n        ;\n    return i;\n}', 'static inline unsigned bitstream_read_bit(BitstreamContext *bc)\n{\n    if (!bc->bits_left)\n        refill_64(bc);\n    return get_val(bc, 1);\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}']