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

libavcodec/indeo5.c:314:22: Call
312.     }
313. 
314.     ctx->frame_num = bitstream_read(&ctx->bc, 8);
                          ^
315. 
316.     if (ctx->frame_type == FRAMETYPE_INTRA) {

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] - 8):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 decode_pic_hdr(IVI45DecContext *ctx, AVCodecContext *avctx)\n{\n    int ret;\n    if (bitstream_read(&ctx->bc, 5) != 0x1F) {\n        av_log(avctx, AV_LOG_ERROR, "Invalid picture start code!\\n");\n        return AVERROR_INVALIDDATA;\n    }\n    ctx->prev_frame_type = ctx->frame_type;\n    ctx->frame_type      = bitstream_read(&ctx->bc, 3);\n    if (ctx->frame_type >= 5) {\n        av_log(avctx, AV_LOG_ERROR, "Invalid frame type: %d \\n", ctx->frame_type);\n        return AVERROR_INVALIDDATA;\n    }\n    ctx->frame_num = bitstream_read(&ctx->bc, 8);\n    if (ctx->frame_type == FRAMETYPE_INTRA) {\n        if ((ret = decode_gop_header(ctx, avctx)) < 0) {\n            av_log(avctx, AV_LOG_ERROR, "Invalid GOP header, skipping frames.\\n");\n            ctx->gop_invalid = 1;\n            return ret;\n        }\n        ctx->gop_invalid = 0;\n    }\n    if (ctx->frame_type != FRAMETYPE_NULL) {\n        ctx->frame_flags = bitstream_read(&ctx->bc, 8);\n        ctx->pic_hdr_size = (ctx->frame_flags & 1) ? bitstream_read(&ctx->bc, 24) : 0;\n        ctx->checksum = (ctx->frame_flags & 0x10) ? bitstream_read(&ctx->bc, 16) : 0;\n        if (ctx->frame_flags & 0x20)\n            skip_hdr_extension(&ctx->bc);\n        ret = ff_ivi_dec_huff_desc(&ctx->bc, ctx->frame_flags & 0x40,\n                                   IVI_MB_HUFF, &ctx->mb_vlc, avctx);\n        if (ret < 0)\n            return ret;\n        bitstream_skip(&ctx->bc, 3);\n    }\n    bitstream_align(&ctx->bc);\n    return 0;\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}']