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

libavcodec/cbs_h2645.c:85:1: Parameter `bc->bits_left`
83. }
84. 
85. static int cbs_read_se_golomb(CodedBitstreamContext *ctx, BitstreamContext *bc,
    ^
86.                               const char *name, int32_t *write_to,
87.                               int32_t range_min, int32_t range_max)

libavcodec/cbs_h2645.c:101:17: Call
 99. 
100.         for (i = 0; i < 32; i++) {
101.             k = bitstream_read_bit(bc);
                     ^
102.             bits[i] = k ? '1' : '0';
103.             if (k)

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

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

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

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

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

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

libavcodec/bitstream.h:138:5: Binary operation: ([0, max(64, bc->bits_left)] - 1):unsigned32 by call to `bitstream_read_bit` 
    136.     bc->bits <<= n;
    137. #endif
    138.     bc->bits_left -= n;
             ^
    139. 
    140.     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 int cbs_read_se_golomb(CodedBitstreamContext *ctx, BitstreamContext *bc,\n                              const char *name, int32_t *write_to,\n                              int32_t range_min, int32_t range_max)\n{\n    int32_t value;\n    int position;\n    if (ctx->trace_enable) {\n        char bits[65];\n        uint32_t v;\n        unsigned int k;\n        int i, j;\n        position = bitstream_tell(bc);\n        for (i = 0; i < 32; i++) {\n            k = bitstream_read_bit(bc);\n            bits[i] = k ? \'1\' : \'0\';\n            if (k)\n                break;\n        }\n        if (i >= 32) {\n            av_log(ctx->log_ctx, AV_LOG_ERROR, "Invalid se-golomb "\n                   "code found while reading %s: "\n                   "more than 31 zeroes.\\n", name);\n            return AVERROR_INVALIDDATA;\n        }\n        v = 1;\n        for (j = 0; j < i; j++) {\n            k = bitstream_read_bit(bc);\n            bits[i + j + 1] = k ? \'1\' : \'0\';\n            v = v << 1 | k;\n        }\n        bits[i + j + 1] = 0;\n        if (v & 1)\n            value = -(int32_t)(v / 2);\n        else\n            value = v / 2;\n        ff_cbs_trace_syntax_element(ctx, position, name, bits, value);\n    } else {\n        value = get_se_golomb_long(bc);\n    }\n    if (value < range_min || value > range_max) {\n        av_log(ctx->log_ctx, AV_LOG_ERROR, "%s out of range: "\n               "%"PRId32", but must be in [%"PRId32",%"PRId32"].\\n",\n               name, value, range_min, range_max);\n        return AVERROR_INVALIDDATA;\n    }\n    *write_to = value;\n    return 0;\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}']