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

libavcodec/proresenc.c:489:16: Call
487. 
488.     prev_dc  = (blocks[0] - 0x4000) / scale;
489.     bits     = estimate_vlc(FIRST_DC_CB, MAKE_CODE(prev_dc));
                    ^
490.     sign     = 0;
491.     codebook = 3;

libavcodec/proresenc.c:473:20: <LHS trace>
471.     if (val >= switch_val) {
472.         val -= switch_val - (1 << exp_order);
473.         exponent = av_log2(val);
                        ^
474. 
475.         return exponent * 2 - exp_order + switch_bits + 1;

libavcodec/proresenc.c:473:20: Call
  471.     if (val >= switch_val) {
  472.         val -= switch_val - (1 << exp_order);
  473.         exponent = av_log2(val);
                          ^
  474. 
  475.         return exponent * 2 - exp_order + switch_bits + 1;

libavutil/common.h:71:1: Global `ff_log2_tab`
    69. #endif
    70. 
    71. static av_always_inline av_const int av_log2_c(unsigned int v)
        ^
    72. {
    73.     int n = 0;

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

libavutil/common.h:84:5: Assignment
    82.     n += ff_log2_tab[v];
    83. 
    84.     return n;
            ^
    85. }
    86. 

libavcodec/proresenc.c:473:9: Assignment
  471.     if (val >= switch_val) {
  472.         val -= switch_val - (1 << exp_order);
  473.         exponent = av_log2(val);
               ^
  474. 
  475.         return exponent * 2 - exp_order + switch_bits + 1;

libavcodec/proresenc.c:459:1: <RHS trace>
457. }
458. 
459. static inline int estimate_vlc(unsigned codebook, int val)
     ^
460. {
461.     unsigned int rice_order, exp_order, switch_bits, switch_val;

libavcodec/proresenc.c:459:1: Parameter `codebook`
  457. }
  458. 
  459. static inline int estimate_vlc(unsigned codebook, int val)
       ^
  460. {
  461.     unsigned int rice_order, exp_order, switch_bits, switch_val;

libavcodec/proresenc.c:467:5: Assignment
  465.     switch_bits = (codebook & 3) + 1;
  466.     rice_order  =  codebook >> 5;       /* rice code order */
  467.     exp_order   = (codebook >> 2) & 7;  /* exp golomb code order */
           ^
  468. 
  469.     switch_val  = switch_bits << rice_order;

libavcodec/proresenc.c:475:9: Binary operation: ([0, +oo] - [0, 7]):unsigned32 by call to `estimate_vlc` 
  473.         exponent = av_log2(val);
  474. 
  475.         return exponent * 2 - exp_order + switch_bits + 1;
               ^
  476.     } else {
  477.         return (val >> rice_order) + rice_order + 1;

static inline int estimate_vlc(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);
        return exponent * 2 - exp_order + switch_bits + 1;
    } else {
        return (val >> rice_order) + rice_order + 1;
    }
}
['static int estimate_dcs(int *error, DCTELEM *blocks, int blocks_per_slice,\n                        int scale)\n{\n    int i;\n    int codebook = 3, code, dc, prev_dc, delta, sign, new_sign;\n    int bits;\n    prev_dc  = (blocks[0] - 0x4000) / scale;\n    bits     = estimate_vlc(FIRST_DC_CB, MAKE_CODE(prev_dc));\n    sign     = 0;\n    codebook = 3;\n    blocks  += 64;\n    *error  += FFABS(blocks[0] - 0x4000) % scale;\n    for (i = 1; i < blocks_per_slice; i++, blocks += 64) {\n        dc       = (blocks[0] - 0x4000) / scale;\n        *error  += FFABS(blocks[0] - 0x4000) % scale;\n        delta    = dc - prev_dc;\n        new_sign = GET_SIGN(delta);\n        delta    = (delta ^ sign) - sign;\n        code     = MAKE_CODE(delta);\n        bits    += estimate_vlc(ff_prores_dc_codebook[codebook], code);\n        codebook = (code + (code & 1)) >> 1;\n        codebook = FFMIN(codebook, 3);\n        sign     = new_sign;\n        prev_dc  = dc;\n    }\n    return bits;\n}', 'static inline int estimate_vlc(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        return exponent * 2 - exp_order + switch_bits + 1;\n    } else {\n        return (val >> rice_order) + rice_order + 1;\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}']