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

libavcodec/proresenc.c:272:5: Call
270. 
271.     prev_dc = (blocks[0] - 0x4000) / scale;
272.     encode_vlc_codeword(pb, FIRST_DC_CB, MAKE_CODE(prev_dc));
         ^
273.     sign     = 0;
274.     codebook = 3;

libavcodec/proresenc.c:246:20: <LHS trace>
244.     if (val >= switch_val) {
245.         val -= switch_val - (1 << exp_order);
246.         exponent = av_log2(val);
                        ^
247. 
248.         put_bits(pb, exponent - exp_order + switch_bits, 0);

libavcodec/proresenc.c:246:20: Call
  244.     if (val >= switch_val) {
  245.         val -= switch_val - (1 << exp_order);
  246.         exponent = av_log2(val);
                          ^
  247. 
  248.         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:246:9: Assignment
  244.     if (val >= switch_val) {
  245.         val -= switch_val - (1 << exp_order);
  246.         exponent = av_log2(val);
               ^
  247. 
  248.         put_bits(pb, exponent - exp_order + switch_bits, 0);

libavcodec/proresenc.c:232:1: <RHS trace>
230.  * Write an unsigned rice/exp golomb codeword.
231.  */
232. static inline void encode_vlc_codeword(PutBitContext *pb, unsigned codebook, int val)
     ^
233. {
234.     unsigned int rice_order, exp_order, switch_bits, switch_val;

libavcodec/proresenc.c:232:1: Parameter `codebook`
  230.  * Write an unsigned rice/exp golomb codeword.
  231.  */
  232. static inline void encode_vlc_codeword(PutBitContext *pb, unsigned codebook, int val)
       ^
  233. {
  234.     unsigned int rice_order, exp_order, switch_bits, switch_val;

libavcodec/proresenc.c:240:5: Assignment
  238.     switch_bits = (codebook & 3) + 1;
  239.     rice_order  =  codebook >> 5;       /* rice code order */
  240.     exp_order   = (codebook >> 2) & 7;  /* exp golomb code order */
           ^
  241. 
  242.     switch_val  = switch_bits << rice_order;

libavcodec/proresenc.c:248:9: Binary operation: ([0, +oo] - [0, 7]):unsigned32 by call to `encode_vlc_codeword` 
  246.         exponent = av_log2(val);
  247. 
  248.         put_bits(pb, exponent - exp_order + switch_bits, 0);
               ^
  249.         put_bits(pb, 1, 1);
  250.         put_bits(pb, exponent, val);

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, 1, 1);
        put_bits(pb, exponent, 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 void encode_dcs(PutBitContext *pb, DCTELEM *blocks,\n                       int blocks_per_slice, int scale)\n{\n    int i;\n    int codebook = 3, code, dc, prev_dc, delta, sign, new_sign;\n    prev_dc = (blocks[0] - 0x4000) / scale;\n    encode_vlc_codeword(pb, FIRST_DC_CB, MAKE_CODE(prev_dc));\n    sign     = 0;\n    codebook = 3;\n    blocks  += 64;\n    for (i = 1; i < blocks_per_slice; i++, blocks += 64) {\n        dc       = (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        encode_vlc_codeword(pb, 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}', '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, 1, 1);\n        put_bits(pb, exponent, 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}']