libavcodec/proresenc.c:389: error: Integer Overflow L2
  ([0, +oo] - [0, 7]):unsigned32 by call to `encode_acs`.

libavcodec/proresenc.c:389:5: Call
387. 
388.     encode_dcs(pb, blocks, blocks_per_slice, qmat[0]);
389.     encode_acs(pb, blocks, blocks_per_slice, plane_size_factor,
         ^
390.                ctx->scantable.permutated, qmat);
391.     flush_put_bits(pb);

libavcodec/proresenc.c:343:1: Global `ff_prores_ac_codebook`
  341. }
  342. 
  343. static void encode_acs(PutBitContext *pb, DCTELEM *blocks,
       ^
  344.                        int blocks_per_slice,
  345.                        int plane_size_factor,

libavcodec/proresenc.c:362:17: Call
  360.             if (level) {
  361.                 abs_level = FFABS(level);
  362.                 encode_vlc_codeword(pb, ff_prores_ac_codebook[run_cb], run);
                       ^
  363.                 encode_vlc_codeword(pb, ff_prores_ac_codebook[lev_cb],
  364.                                     abs_level - 1);

libavcodec/proresenc.c:299:20: <LHS trace>
297.     if (val >= switch_val) {
298.         val -= switch_val - (1 << exp_order);
299.         exponent = av_log2(val);
                        ^
300. 
301.         put_bits(pb, exponent - exp_order + switch_bits, 0);

libavcodec/proresenc.c:299:20: Call
    297.     if (val >= switch_val) {
    298.         val -= switch_val - (1 << exp_order);
    299.         exponent = av_log2(val);
                            ^
    300. 
    301.         put_bits(pb, exponent - exp_order + switch_bits, 0);

libavutil/common.h:67:1: Global `ff_log2_tab`
      65. extern const uint8_t av_reverse[256];
      66. 
      67. static av_always_inline av_const int av_log2_c(unsigned int v)
          ^
      68. {
      69.     int n = 0;

libavutil/common.h:78:5: Assignment
      76.         n += 8;
      77.     }
      78.     n += ff_log2_tab[v];
              ^
      79. 
      80.     return n;

libavutil/common.h:80:5: Assignment
      78.     n += ff_log2_tab[v];
      79. 
      80.     return n;
              ^
      81. }
      82. 

libavcodec/proresenc.c:299:9: Assignment
    297.     if (val >= switch_val) {
    298.         val -= switch_val - (1 << exp_order);
    299.         exponent = av_log2(val);
                 ^
    300. 
    301.         put_bits(pb, exponent - exp_order + switch_bits, 0);

libavcodec/proresenc.c:285:1: <RHS trace>
283.  * Write an unsigned rice/exp golomb codeword.
284.  */
285. static inline void encode_vlc_codeword(PutBitContext *pb, unsigned codebook, int val)
     ^
286. {
287.     unsigned int rice_order, exp_order, switch_bits, switch_val;

libavcodec/proresenc.c:285:1: Parameter `codebook`
    283.  * Write an unsigned rice/exp golomb codeword.
    284.  */
    285. static inline void encode_vlc_codeword(PutBitContext *pb, unsigned codebook, int val)
         ^
    286. {
    287.     unsigned int rice_order, exp_order, switch_bits, switch_val;

libavcodec/proresenc.c:293:5: Assignment
    291.     switch_bits = (codebook & 3) + 1;
    292.     rice_order  =  codebook >> 5;       /* rice code order */
    293.     exp_order   = (codebook >> 2) & 7;  /* exp golomb code order */
             ^
    294. 
    295.     switch_val  = switch_bits << rice_order;

libavcodec/proresenc.c:301:9: Binary operation: ([0, +oo] - [0, 7]):unsigned32 by call to `encode_acs` 
    299.         exponent = av_log2(val);
    300. 
    301.         put_bits(pb, exponent - exp_order + switch_bits, 0);
                 ^
    302.         put_bits(pb, exponent + 1, val);
    303.     } else {

static inline void encode_vlc_codeword(PutBitContext *pb, unsigned codebook, int val)
{
    unsigned int rice_order, exp_order, switch_bits, switch_val;
    int exponent;
    switch_bits = (codebook & 3) + 1;
    rice_order  =  codebook >> 5;
    exp_order   = (codebook >> 2) & 7;
    switch_val  = switch_bits << rice_order;
    if (val >= switch_val) {
        val -= switch_val - (1 << exp_order);
        exponent = av_log2(val);
        put_bits(pb, exponent - exp_order + switch_bits, 0);
        put_bits(pb, exponent + 1, val);
    } else {
        exponent = val >> rice_order;
        if (exponent)
            put_bits(pb, exponent, 0);
        put_bits(pb, 1, 1);
        if (rice_order)
            put_sbits(pb, rice_order, val);
    }
}
['static int encode_slice_plane(ProresContext *ctx, PutBitContext *pb,\n                              const uint16_t *src, int linesize,\n                              int mbs_per_slice, DCTELEM *blocks,\n                              int blocks_per_mb, int plane_size_factor,\n                              const int16_t *qmat)\n{\n    int blocks_per_slice, saved_pos;\n    saved_pos = put_bits_count(pb);\n    blocks_per_slice = mbs_per_slice * blocks_per_mb;\n    encode_dcs(pb, blocks, blocks_per_slice, qmat[0]);\n    encode_acs(pb, blocks, blocks_per_slice, plane_size_factor,\n               ctx->scantable.permutated, qmat);\n    flush_put_bits(pb);\n    return (put_bits_count(pb) - saved_pos) >> 3;\n}', 'static void encode_acs(PutBitContext *pb, DCTELEM *blocks,\n                       int blocks_per_slice,\n                       int plane_size_factor,\n                       const uint8_t *scan, const int16_t *qmat)\n{\n    int idx, i;\n    int run, level, run_cb, lev_cb;\n    int max_coeffs, abs_level;\n    max_coeffs = blocks_per_slice << 6;\n    run_cb     = ff_prores_run_to_cb_index[4];\n    lev_cb     = ff_prores_lev_to_cb_index[2];\n    run        = 0;\n    for (i = 1; i < 64; i++) {\n        for (idx = scan[i]; idx < max_coeffs; idx += 64) {\n            level = blocks[idx] / qmat[scan[i]];\n            if (level) {\n                abs_level = FFABS(level);\n                encode_vlc_codeword(pb, ff_prores_ac_codebook[run_cb], run);\n                encode_vlc_codeword(pb, ff_prores_ac_codebook[lev_cb],\n                                    abs_level - 1);\n                put_sbits(pb, 1, GET_SIGN(level));\n                run_cb = ff_prores_run_to_cb_index[FFMIN(run, 15)];\n                lev_cb = ff_prores_lev_to_cb_index[FFMIN(abs_level, 9)];\n                run    = 0;\n            } else {\n                run++;\n            }\n        }\n    }\n}', 'static inline void encode_vlc_codeword(PutBitContext *pb, unsigned codebook, int val)\n{\n    unsigned int rice_order, exp_order, switch_bits, switch_val;\n    int exponent;\n    switch_bits = (codebook & 3) + 1;\n    rice_order  =  codebook >> 5;\n    exp_order   = (codebook >> 2) & 7;\n    switch_val  = switch_bits << rice_order;\n    if (val >= switch_val) {\n        val -= switch_val - (1 << exp_order);\n        exponent = av_log2(val);\n        put_bits(pb, exponent - exp_order + switch_bits, 0);\n        put_bits(pb, exponent + 1, val);\n    } else {\n        exponent = val >> rice_order;\n        if (exponent)\n            put_bits(pb, exponent, 0);\n        put_bits(pb, 1, 1);\n        if (rice_order)\n            put_sbits(pb, rice_order, val);\n    }\n}', 'static av_always_inline av_const int av_log2_c(unsigned int v)\n{\n    int n = 0;\n    if (v & 0xffff0000) {\n        v >>= 16;\n        n += 16;\n    }\n    if (v & 0xff00) {\n        v >>= 8;\n        n += 8;\n    }\n    n += ff_log2_tab[v];\n    return n;\n}']