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

libavcodec/vp9_superframe_split_bsf.c:110:9: Call
108.             goto fail;
109. 
110.         bitstream_read(&bc, 2); // frame_marker
             ^
111.         profile  = bitstream_read(&bc, 1);
112.         profile |= bitstream_read(&bc, 1) << 1;

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] - 2):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 vp9_superframe_split_filter(AVBSFContext *ctx, AVPacket *out)\n{\n    VP9SFSplitContext *s = ctx->priv_data;\n    AVPacket *in;\n    int i, j, ret, marker;\n    int is_superframe = !!s->buffer_pkt;\n    if (!s->buffer_pkt) {\n        ret = ff_bsf_get_packet(ctx, &s->buffer_pkt);\n        if (ret < 0)\n            return ret;\n        in = s->buffer_pkt;\n        marker = in->data[in->size - 1];\n        if ((marker & 0xe0) == 0xc0) {\n            int length_size = 1 + ((marker >> 3) & 0x3);\n            int   nb_frames = 1 + (marker & 0x7);\n            int    idx_size = 2 + nb_frames * length_size;\n            if (in->size >= idx_size && in->data[in->size - idx_size] == marker) {\n                GetByteContext bc;\n                int total_size = 0;\n                bytestream2_init(&bc, in->data + in->size + 1 - idx_size,\n                                 nb_frames * length_size);\n                for (i = 0; i < nb_frames; i++) {\n                    int frame_size = 0;\n                    for (j = 0; j < length_size; j++)\n                        frame_size |= bytestream2_get_byte(&bc) << (j * 8);\n                    total_size += frame_size;\n                    if (total_size > in->size - idx_size) {\n                        av_log(ctx, AV_LOG_ERROR,\n                               "Invalid frame size in a superframe: %d\\n", frame_size);\n                        ret = AVERROR(EINVAL);\n                        goto fail;\n                    }\n                    s->sizes[i] = frame_size;\n                }\n                s->nb_frames         = nb_frames;\n                s->next_frame        = 0;\n                s->next_frame_offset = 0;\n                is_superframe        = 1;\n            }\n        }\n    }\n    if (is_superframe) {\n        BitstreamContext bc;\n        int profile, invisible = 0;\n        ret = av_packet_ref(out, s->buffer_pkt);\n        if (ret < 0)\n            goto fail;\n        out->data += s->next_frame_offset;\n        out->size  = s->sizes[s->next_frame];\n        s->next_frame_offset += out->size;\n        s->next_frame++;\n        if (s->next_frame >= s->nb_frames)\n            av_packet_free(&s->buffer_pkt);\n        ret = bitstream_init8(&bc, out->data, out->size);\n        if (ret < 0)\n            goto fail;\n        bitstream_read(&bc, 2);\n        profile  = bitstream_read(&bc, 1);\n        profile |= bitstream_read(&bc, 1) << 1;\n        if (profile == 3)\n            bitstream_read(&bc, 1);\n        if (!bitstream_read(&bc, 1)) {\n            bitstream_read(&bc, 1);\n            invisible = !bitstream_read(&bc, 1);\n        }\n        if (invisible)\n            out->pts = AV_NOPTS_VALUE;\n    } else {\n        av_packet_move_ref(out, s->buffer_pkt);\n        av_packet_free(&s->buffer_pkt);\n    }\n    return 0;\nfail:\n    av_packet_free(&s->buffer_pkt);\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}']