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

libavcodec/webp.c:1115:13: Call
1113.         s->has_alpha = bitstream_read_bit(&s->bc);
1114. 
1115.         if (bitstream_read(&s->bc, 3) != 0x0) {
                  ^
1116.             av_log(avctx, AV_LOG_ERROR, "Invalid WebP Lossless version\n");
1117.             return AVERROR_INVALIDDATA;

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] - 3):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 vp8_lossless_decode_frame(AVCodecContext *avctx, AVFrame *p,\n                                     int *got_frame, uint8_t *data_start,\n                                     unsigned int data_size, int is_alpha_chunk)\n{\n    WebPContext *s = avctx->priv_data;\n    int w, h, ret, i, used;\n    if (!is_alpha_chunk) {\n        s->lossless = 1;\n        avctx->pix_fmt = AV_PIX_FMT_ARGB;\n    }\n    ret = bitstream_init(&s->bc, data_start, data_size * 8);\n    if (ret < 0)\n        return ret;\n    if (!is_alpha_chunk) {\n        if (bitstream_read(&s->bc, 8) != 0x2F) {\n            av_log(avctx, AV_LOG_ERROR, "Invalid WebP Lossless signature\\n");\n            return AVERROR_INVALIDDATA;\n        }\n        w = bitstream_read(&s->bc, 14) + 1;\n        h = bitstream_read(&s->bc, 14) + 1;\n        if (s->width && s->width != w) {\n            av_log(avctx, AV_LOG_WARNING, "Width mismatch. %d != %d\\n",\n                   s->width, w);\n        }\n        s->width = w;\n        if (s->height && s->height != h) {\n            av_log(avctx, AV_LOG_WARNING, "Height mismatch. %d != %d\\n",\n                   s->width, w);\n        }\n        s->height = h;\n        ret = ff_set_dimensions(avctx, s->width, s->height);\n        if (ret < 0)\n            return ret;\n        s->has_alpha = bitstream_read_bit(&s->bc);\n        if (bitstream_read(&s->bc, 3) != 0x0) {\n            av_log(avctx, AV_LOG_ERROR, "Invalid WebP Lossless version\\n");\n            return AVERROR_INVALIDDATA;\n        }\n    } else {\n        if (!s->width || !s->height)\n            return AVERROR_BUG;\n        w = s->width;\n        h = s->height;\n    }\n    s->nb_transforms = 0;\n    s->reduced_width = 0;\n    used = 0;\n    while (bitstream_read_bit(&s->bc)) {\n        enum TransformType transform = bitstream_read(&s->bc, 2);\n        s->transforms[s->nb_transforms++] = transform;\n        if (used & (1 << transform)) {\n            av_log(avctx, AV_LOG_ERROR, "Transform %d used more than once\\n",\n                   transform);\n            ret = AVERROR_INVALIDDATA;\n            goto free_and_return;\n        }\n        used |= (1 << transform);\n        switch (transform) {\n        case PREDICTOR_TRANSFORM:\n            ret = parse_transform_predictor(s);\n            break;\n        case COLOR_TRANSFORM:\n            ret = parse_transform_color(s);\n            break;\n        case COLOR_INDEXING_TRANSFORM:\n            ret = parse_transform_color_indexing(s);\n            break;\n        }\n        if (ret < 0)\n            goto free_and_return;\n    }\n    s->image[IMAGE_ROLE_ARGB].frame = p;\n    if (is_alpha_chunk)\n        s->image[IMAGE_ROLE_ARGB].is_alpha_primary = 1;\n    ret = decode_entropy_coded_image(s, IMAGE_ROLE_ARGB, w, h);\n    if (ret < 0)\n        goto free_and_return;\n    for (i = s->nb_transforms - 1; i >= 0; i--) {\n        switch (s->transforms[i]) {\n        case PREDICTOR_TRANSFORM:\n            ret = apply_predictor_transform(s);\n            break;\n        case COLOR_TRANSFORM:\n            ret = apply_color_transform(s);\n            break;\n        case SUBTRACT_GREEN:\n            ret = apply_subtract_green_transform(s);\n            break;\n        case COLOR_INDEXING_TRANSFORM:\n            ret = apply_color_indexing_transform(s);\n            break;\n        }\n        if (ret < 0)\n            goto free_and_return;\n    }\n    *got_frame   = 1;\n    p->pict_type = AV_PICTURE_TYPE_I;\n    p->key_frame = 1;\n    ret          = data_size;\nfree_and_return:\n    for (i = 0; i < IMAGE_ROLE_NB; i++)\n        image_ctx_free(&s->image[i]);\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}']