libavcodec/webp.c:356: error: Integer Overflow L2
  ([1, +oo] - 4):unsigned32 by call to `bitstream_read`.

libavcodec/webp.c:356:25: Call
354.     int code_length_code_lengths[NUM_CODE_LENGTH_CODES] = { 0 };
355.     int i, symbol, max_symbol, prev_code_len, ret;
356.     int num_codes = 4 + bitstream_read(&s->bc, 4);
                             ^
357. 
358.     if (num_codes > NUM_CODE_LENGTH_CODES)

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] - 4):unsigned32 by call to `bitstream_read` 
    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 int read_huffman_code_normal(WebPContext *s, HuffReader *hc,\n                                    int alphabet_size)\n{\n    HuffReader code_len_hc = { { 0 }, 0, 0, { 0 } };\n    int *code_lengths = NULL;\n    int code_length_code_lengths[NUM_CODE_LENGTH_CODES] = { 0 };\n    int i, symbol, max_symbol, prev_code_len, ret;\n    int num_codes = 4 + bitstream_read(&s->bc, 4);\n    if (num_codes > NUM_CODE_LENGTH_CODES)\n        return AVERROR_INVALIDDATA;\n    for (i = 0; i < num_codes; i++)\n        code_length_code_lengths[code_length_code_order[i]] = bitstream_read(&s->bc, 3);\n    ret = huff_reader_build_canonical(&code_len_hc, code_length_code_lengths,\n                                      NUM_CODE_LENGTH_CODES);\n    if (ret < 0)\n        goto finish;\n    code_lengths = av_mallocz_array(alphabet_size, sizeof(*code_lengths));\n    if (!code_lengths) {\n        ret = AVERROR(ENOMEM);\n        goto finish;\n    }\n    if (bitstream_read_bit(&s->bc)) {\n        int bits   = 2 + 2 * bitstream_read(&s->bc, 3);\n        max_symbol = 2 + bitstream_read(&s->bc, bits);\n        if (max_symbol > alphabet_size) {\n            av_log(s->avctx, AV_LOG_ERROR, "max symbol %d > alphabet size %d\\n",\n                   max_symbol, alphabet_size);\n            ret = AVERROR_INVALIDDATA;\n            goto finish;\n        }\n    } else {\n        max_symbol = alphabet_size;\n    }\n    prev_code_len = 8;\n    symbol        = 0;\n    while (symbol < alphabet_size) {\n        int code_len;\n        if (!max_symbol--)\n            break;\n        code_len = huff_reader_get_symbol(&code_len_hc, &s->bc);\n        if (code_len < 16) {\n            code_lengths[symbol++] = code_len;\n            if (code_len)\n                prev_code_len = code_len;\n        } else {\n            int repeat = 0, length = 0;\n            switch (code_len) {\n            case 16:\n                repeat = 3 + bitstream_read(&s->bc, 2);\n                length = prev_code_len;\n                break;\n            case 17:\n                repeat = 3 + bitstream_read(&s->bc, 3);\n                break;\n            case 18:\n                repeat = 11 + bitstream_read(&s->bc, 7);\n                break;\n            }\n            if (symbol + repeat > alphabet_size) {\n                av_log(s->avctx, AV_LOG_ERROR,\n                       "invalid symbol %d + repeat %d > alphabet size %d\\n",\n                       symbol, repeat, alphabet_size);\n                ret = AVERROR_INVALIDDATA;\n                goto finish;\n            }\n            while (repeat-- > 0)\n                code_lengths[symbol++] = length;\n        }\n    }\n    ret = huff_reader_build_canonical(hc, code_lengths, alphabet_size);\nfinish:\n    ff_free_vlc(&code_len_hc.vlc);\n    av_free(code_lengths);\n    return ret;\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}']