libavcodec/smacker.c:152: error: Integer Overflow L2
  (32 - [0, 126+max(64, `bc->bits_left`)]):unsigned32 by call to `bitstream_read_vlc`.

libavcodec/smacker.c:136:1: Parameter `bc->bits_left`
134.  * Decode header tree
135.  */
136. static int smacker_decode_bigtree(BitstreamContext *bc, HuffContext *hc,
     ^
137.                                   DBCtx *ctx, int length)
138. {

libavcodec/smacker.c:149:10: Call
147.         return AVERROR_INVALIDDATA;
148.     }
149.     if (!bitstream_read_bit(bc)) { // Leaf
              ^
150.         int val, i1, i2;
151.         i1 = ctx->v1->table ? bitstream_read_vlc(bc, ctx->v1->table, SMKTREE_BITS, 3) : 0;

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: 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: Assignment
    136.     bc->bits <<= n;
    137. #endif
    138.     bc->bits_left -= n;
             ^
    139. 
    140.     return ret;

libavcodec/smacker.c:152:31: Call
150.         int val, i1, i2;
151.         i1 = ctx->v1->table ? bitstream_read_vlc(bc, ctx->v1->table, SMKTREE_BITS, 3) : 0;
152.         i2 = ctx->v2->table ? bitstream_read_vlc(bc, ctx->v2->table, SMKTREE_BITS, 3) : 0;
                                   ^
153.         if (i1 < 0 || i2 < 0)
154.             return AVERROR_INVALIDDATA;

libavcodec/vlc.h:90:1: Parameter `bits`
  88.  * If the VLC code is invalid and max_depth > 1, then the number of bits removed
  89.  * is undefined. */
  90. static inline int bitstream_read_vlc(BitstreamContext *bc, VLC_TYPE (*table)[2],
      ^
  91.                                      int bits, int max_depth)
  92. {

libavcodec/vlc.h:99:9: Call
   97. 
   98.     if (max_depth > 1 && n < 0) {
   99.         skip_remaining(bc, bits);
               ^
  100.         code = set_idx(bc, code, &n, &nb_bits, table);
  101.         if (max_depth > 2 && n < 0) {

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

libavcodec/bitstream.h:236:5: Assignment
    234.     bc->bits <<= n;
    235. #endif
    236.     bc->bits_left -= n;
             ^
    237. }
    238. 

libavcodec/vlc.h:100:16: Call
   98.     if (max_depth > 1 && n < 0) {
   99.         skip_remaining(bc, bits);
  100.         code = set_idx(bc, code, &n, &nb_bits, table);
                      ^
  101.         if (max_depth > 2 && n < 0) {
  102.             skip_remaining(bc, nb_bits);

libavcodec/vlc.h:68:1: Parameter `bc->bits_left`
    66. 
    67. /* Return the LUT element for the given bitstream configuration. */
    68. static inline int set_idx(BitstreamContext *bc, int code, int *n, int *nb_bits,
        ^
    69.                           VLC_TYPE (*table)[2])
    70. {

libavcodec/vlc.h:74:11: Call
    72. 
    73.     *nb_bits = -*n;
    74.     idx = bitstream_peek(bc, *nb_bits) + code;
                  ^
    75.     *n = table[idx][1];
    76. 

libavcodec/bitstream.h:214:1: Parameter `n`
      212. /* Return n bits from the buffer, but do not change the buffer state.
      213.  * n has to be in the 0-32 range. */
      214. static inline unsigned bitstream_peek(BitstreamContext *bc, unsigned n)
           ^
      215. {
      216.     if (n > bc->bits_left)

libavcodec/bitstream.h:217:9: Call
      215. {
      216.     if (n > bc->bits_left)
      217.         refill_32(bc);
                   ^
      218. 
      219.     return show_val(bc, n);

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

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

libavcodec/bitstream.h:67:5: Binary operation: (32 - [0, 126+max(64, bc->bits_left)]):unsigned32 by call to `bitstream_read_vlc` 
        65.     bc->bits       = (uint64_t)AV_RL32(bc->ptr) << bc->bits_left | bc->bits;
        66. #else
        67.     bc->bits       = bc->bits | (uint64_t)AV_RB32(bc->ptr) << (32 - bc->bits_left);
                ^
        68. #endif
        69.     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 smacker_decode_bigtree(BitstreamContext *bc, HuffContext *hc,\n                                  DBCtx *ctx, int length)\n{\n    if (length > SMKTREE_DECODE_BIG_MAX_RECURSION) {\n        av_log(NULL, AV_LOG_ERROR, "Maximum bigtree recursion level exceeded.\\n");\n        return AVERROR_INVALIDDATA;\n    }\n    if (hc->current + 1 >= hc->length) {\n        av_log(NULL, AV_LOG_ERROR, "Tree size exceeded!\\n");\n        return AVERROR_INVALIDDATA;\n    }\n    if (!bitstream_read_bit(bc)) {\n        int val, i1, i2;\n        i1 = ctx->v1->table ? bitstream_read_vlc(bc, ctx->v1->table, SMKTREE_BITS, 3) : 0;\n        i2 = ctx->v2->table ? bitstream_read_vlc(bc, ctx->v2->table, SMKTREE_BITS, 3) : 0;\n        if (i1 < 0 || i2 < 0)\n            return AVERROR_INVALIDDATA;\n        val = ctx->recode1[i1] | (ctx->recode2[i2] << 8);\n        if(val == ctx->escapes[0]) {\n            ctx->last[0] = hc->current;\n            val = 0;\n        } else if(val == ctx->escapes[1]) {\n            ctx->last[1] = hc->current;\n            val = 0;\n        } else if(val == ctx->escapes[2]) {\n            ctx->last[2] = hc->current;\n            val = 0;\n        }\n        hc->values[hc->current++] = val;\n        return 1;\n    } else {\n        int r = 0, r_new, t;\n        t = hc->current++;\n        r = smacker_decode_bigtree(bc, hc, ctx, length + 1);\n        if(r < 0)\n            return r;\n        hc->values[t] = SMK_NODE | r;\n        r++;\n        r_new = smacker_decode_bigtree(bc, hc, ctx, length + 1);\n        if (r_new < 0)\n            return r_new;\n        return r + r_new;\n    }\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}', 'static inline int bitstream_read_vlc(BitstreamContext *bc, VLC_TYPE (*table)[2],\n                                     int bits, int max_depth)\n{\n    int nb_bits;\n    unsigned idx = bitstream_peek(bc, bits);\n    int code = table[idx][0];\n    int n    = table[idx][1];\n    if (max_depth > 1 && n < 0) {\n        skip_remaining(bc, bits);\n        code = set_idx(bc, code, &n, &nb_bits, table);\n        if (max_depth > 2 && n < 0) {\n            skip_remaining(bc, nb_bits);\n            code = set_idx(bc, code, &n, &nb_bits, table);\n        }\n    }\n    skip_remaining(bc, n);\n    return code;\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}', 'static inline int set_idx(BitstreamContext *bc, int code, int *n, int *nb_bits,\n                          VLC_TYPE (*table)[2])\n{\n    unsigned idx;\n    *nb_bits = -*n;\n    idx = bitstream_peek(bc, *nb_bits) + code;\n    *n = table[idx][1];\n    return table[idx][0];\n}', 'static inline unsigned bitstream_peek(BitstreamContext *bc, unsigned n)\n{\n    if (n > bc->bits_left)\n        refill_32(bc);\n    return show_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}']