libavcodec/ffv1dec.c:240: error: Integer Overflow L2
  ([1, +oo] - [2, 1+max(8, `s->avctx->bits_per_raw_sample`)]):unsigned32 by call to `decode_line`.

libavcodec/ffv1dec.c:214:16: Assignment
212.     int16_t *sample[4][2];
213.     int lbd  = s->avctx->bits_per_raw_sample <= 8;
214.     int bits = s->avctx->bits_per_raw_sample > 0
                    ^
215.                ? s->avctx->bits_per_raw_sample
216.                : 8;

libavcodec/ffv1dec.c:214:5: Assignment
212.     int16_t *sample[4][2];
213.     int lbd  = s->avctx->bits_per_raw_sample <= 8;
214.     int bits = s->avctx->bits_per_raw_sample > 0
         ^
215.                ? s->avctx->bits_per_raw_sample
216.                : 8;

libavcodec/ffv1dec.c:240:17: Call
238.                 decode_line(s, w, sample[p], (p + 1) / 2, 9);
239.             else
240.                 decode_line(s, w, sample[p], (p + 1) / 2, bits + 1);
                     ^
241.         }
242.         for (x = 0; x < w; x++) {

libavcodec/ffv1dec.c:96:1: Parameter `bits`
  94. }
  95. 
  96. static av_always_inline void decode_line(FFV1Context *s, int w,
      ^
  97.                                          int16_t *sample[2],
  98.                                          int plane_index, int bits)

libavcodec/ffv1dec.c:145:33: Call
  143.                     run_mode  = 0;
  144.                     run_count = 0;
  145.                     diff      = get_vlc_symbol(&s->bc, &p->vlc_state[context],
                                       ^
  146.                                                bits);
  147.                     if (diff >= 0)

libavcodec/ffv1dec.c:69:1: Parameter `bits`
    67. }
    68. 
    69. static inline int get_vlc_symbol(BitstreamContext *bc, VlcState *const state,
        ^
    70.                                  int bits)
    71. {

libavcodec/ffv1dec.c:83:9: Call
    81.     assert(k <= 8);
    82. 
    83.     v = get_sr_golomb(bc, k, 12, bits);
                ^
    84.     ff_dlog(NULL, "v:%d bias:%d error:%d drift:%d count:%d k:%d",
    85.             v, state->bias, state->error_sum, state->drift, state->count, k);

libavcodec/golomb.h:317:1: Parameter `esc_len`
      315.  * read signed golomb rice code (ffv1).
      316.  */
      317. static inline int get_sr_golomb(BitstreamContext *bc, int k, int limit,
           ^
      318.                                 int esc_len)
      319. {

libavcodec/golomb.h:320:13: Call
      318.                                 int esc_len)
      319. {
      320.     int v = get_ur_golomb(bc, k, limit, esc_len);
                       ^
      321. 
      322.     v++;

libavcodec/golomb.h:248:1: Parameter `esc_len`
        246.  * read unsigned golomb rice code (ffv1).
        247.  */
        248. static inline int get_ur_golomb(BitstreamContext *bc, int k, int limit,
             ^
        249.                                 int esc_len)
        250. {

libavcodec/golomb.h:266:15: Call
        264.     } else {
        265.         bitstream_skip(bc, limit);
        266.         buf = bitstream_read(bc, esc_len);
                           ^
        267. 
        268.         return buf + limit - 1;

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:194:12: Call
          192.     }
          193. 
          194.     return get_val(bc, n);
                          ^
          195. }
          196. 

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: ([1, +oo] - [2, 1+max(8, s->avctx->bits_per_raw_sample)]):unsigned32 by call to `decode_line` 
            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 void decode_rgb_frame(FFV1Context *s, uint8_t *src[3], int w, int h,\n                             int stride[3])\n{\n    int x, y, p;\n    int16_t *sample[4][2];\n    int lbd  = s->avctx->bits_per_raw_sample <= 8;\n    int bits = s->avctx->bits_per_raw_sample > 0\n               ? s->avctx->bits_per_raw_sample\n               : 8;\n    int offset = 1 << bits;\n    for (x = 0; x < 4; x++) {\n        sample[x][0] = s->sample_buffer +  x * 2      * (w + 6) + 3;\n        sample[x][1] = s->sample_buffer + (x * 2 + 1) * (w + 6) + 3;\n    }\n    s->run_index = 0;\n    memset(s->sample_buffer, 0, 8 * (w + 6) * sizeof(*s->sample_buffer));\n    for (y = 0; y < h; y++) {\n        for (p = 0; p < 3 + s->transparency; p++) {\n            int16_t *temp = sample[p][0];\n            sample[p][0] = sample[p][1];\n            sample[p][1] = temp;\n            sample[p][1][-1] = sample[p][0][0];\n            sample[p][0][w]  = sample[p][0][w - 1];\n            if (lbd)\n                decode_line(s, w, sample[p], (p + 1) / 2, 9);\n            else\n                decode_line(s, w, sample[p], (p + 1) / 2, bits + 1);\n        }\n        for (x = 0; x < w; x++) {\n            int g = sample[0][1][x];\n            int b = sample[1][1][x];\n            int r = sample[2][1][x];\n            int a = sample[3][1][x];\n            b -= offset;\n            r -= offset;\n            g -= (b + r) >> 2;\n            b += g;\n            r += g;\n            if (lbd)\n                *((uint32_t *)(src[0] + x * 4 + stride[0] * y)) = b +\n                    (g << 8) + (r << 16) + (a << 24);\n            else {\n                *((uint16_t *)(src[0] + x * 2 + stride[0] * y)) = b;\n                *((uint16_t *)(src[1] + x * 2 + stride[1] * y)) = g;\n                *((uint16_t *)(src[2] + x * 2 + stride[2] * y)) = r;\n            }\n        }\n    }\n}', 'static av_always_inline void decode_line(FFV1Context *s, int w,\n                                         int16_t *sample[2],\n                                         int plane_index, int bits)\n{\n    PlaneContext *const p = &s->plane[plane_index];\n    RangeCoder *const c   = &s->c;\n    int x;\n    int run_count = 0;\n    int run_mode  = 0;\n    int run_index = s->run_index;\n    for (x = 0; x < w; x++) {\n        int diff, context, sign;\n        context = get_context(p, sample[1] + x, sample[0] + x, sample[1] + x);\n        if (context < 0) {\n            context = -context;\n            sign    = 1;\n        } else\n            sign = 0;\n        av_assert2(context < p->context_count);\n        if (s->ac != AC_GOLOMB_RICE) {\n            diff = get_symbol_inline(c, p->state[context], 1);\n        } else {\n            if (context == 0 && run_mode == 0)\n                run_mode = 1;\n            if (run_mode) {\n                if (run_count == 0 && run_mode == 1) {\n                    if (bitstream_read_bit(&s->bc)) {\n                        run_count = 1 << ff_log2_run[run_index];\n                        if (x + run_count <= w)\n                            run_index++;\n                    } else {\n                        if (ff_log2_run[run_index])\n                            run_count = bitstream_read(&s->bc, ff_log2_run[run_index]);\n                        else\n                            run_count = 0;\n                        if (run_index)\n                            run_index--;\n                        run_mode = 2;\n                    }\n                }\n                run_count--;\n                if (run_count < 0) {\n                    run_mode  = 0;\n                    run_count = 0;\n                    diff      = get_vlc_symbol(&s->bc, &p->vlc_state[context],\n                                               bits);\n                    if (diff >= 0)\n                        diff++;\n                } else\n                    diff = 0;\n            } else\n                diff = get_vlc_symbol(&s->bc, &p->vlc_state[context], bits);\n            ff_dlog(s->avctx, "count:%d index:%d, mode:%d, x:%d pos:%d\\n",\n                    run_count, run_index, run_mode, x, bitstream_tell(&s->bc));\n        }\n        if (sign)\n            diff = -diff;\n        sample[1][x] = (predict(sample[1] + x, sample[0] + x) + diff) &\n                       ((1 << bits) - 1);\n    }\n    s->run_index = run_index;\n}', 'static inline int get_vlc_symbol(BitstreamContext *bc, VlcState *const state,\n                                 int bits)\n{\n    int k, i, v, ret;\n    i = state->count;\n    k = 0;\n    while (i < state->error_sum) {\n        k++;\n        i += i;\n    }\n    assert(k <= 8);\n    v = get_sr_golomb(bc, k, 12, bits);\n    ff_dlog(NULL, "v:%d bias:%d error:%d drift:%d count:%d k:%d",\n            v, state->bias, state->error_sum, state->drift, state->count, k);\n    v ^= ((2 * state->drift + state->count) >> 31);\n    ret = fold(v + state->bias, bits);\n    update_vlc_state(state, v);\n    return ret;\n}', 'static inline int get_sr_golomb(BitstreamContext *bc, int k, int limit,\n                                int esc_len)\n{\n    int v = get_ur_golomb(bc, k, limit, esc_len);\n    v++;\n    if (v & 1)\n        return v >> 1;\n    else\n        return -(v >> 1);\n}', 'static inline int get_ur_golomb(BitstreamContext *bc, int k, int limit,\n                                int esc_len)\n{\n    unsigned int buf;\n    int log;\n    buf = bitstream_peek(bc, 32);\n    log = av_log2(buf);\n    if (log > 31 - limit) {\n        buf >>= log - k;\n        buf  += (30 - log) << k;\n        bitstream_skip(bc, 32 + k - log);\n        return buf;\n    } else {\n        bitstream_skip(bc, limit);\n        buf = bitstream_read(bc, esc_len);\n        return buf + limit - 1;\n    }\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 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}']