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

libavcodec/h261dec.c:393:26: Call
391.     // Read mquant
392.     if (IS_QUANT(h->mtype))
393.         ff_set_qscale(s, bitstream_read(&s->bc, 5));
                              ^
394. 
395.     s->mb_intra = IS_INTRA4x4(h->mtype);

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] - 5):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 h261_decode_mb(H261Context *h)\n{\n    MpegEncContext *const s = &h->s;\n    int i, cbp, xy;\n    cbp = 63;\n    do {\n        h->mba_diff = bitstream_read_vlc(&s->bc, h261_mba_vlc.table,\n                                         H261_MBA_VLC_BITS, 2);\n        if (h->mba_diff == MBA_STARTCODE) {\n            h->gob_start_code_skipped = 1;\n            return SLICE_END;\n        }\n    } while (h->mba_diff == MBA_STUFFING);\n    if (h->mba_diff < 0) {\n        if (bitstream_bits_left(&s->bc) <= 7)\n            return SLICE_END;\n        av_log(s->avctx, AV_LOG_ERROR, "illegal mba at %d %d\\n", s->mb_x, s->mb_y);\n        return SLICE_ERROR;\n    }\n    h->mba_diff    += 1;\n    h->current_mba += h->mba_diff;\n    if (h->current_mba > MBA_STUFFING)\n        return SLICE_ERROR;\n    s->mb_x = ((h->gob_number - 1) % 2) * 11 + ((h->current_mba - 1) % 11);\n    s->mb_y = ((h->gob_number - 1) / 2) * 3 + ((h->current_mba - 1) / 11);\n    xy      = s->mb_x + s->mb_y * s->mb_stride;\n    ff_init_block_index(s);\n    ff_update_block_index(s);\n    h->mtype = bitstream_read_vlc(&s->bc, h261_mtype_vlc.table, H261_MTYPE_VLC_BITS, 2);\n    if (h->mtype < 0 || h->mtype >= FF_ARRAY_ELEMS(ff_h261_mtype_map)) {\n        av_log(s->avctx, AV_LOG_ERROR, "Invalid mtype index %d\\n",\n               h->mtype);\n        return SLICE_ERROR;\n    }\n    h->mtype = ff_h261_mtype_map[h->mtype];\n    if (IS_QUANT(h->mtype))\n        ff_set_qscale(s, bitstream_read(&s->bc, 5));\n    s->mb_intra = IS_INTRA4x4(h->mtype);\n    if (IS_16X16(h->mtype)) {\n        if ((h->current_mba ==  1) || (h->current_mba == 12) ||\n            (h->current_mba == 23) || (h->mba_diff != 1)) {\n            h->current_mv_x = 0;\n            h->current_mv_y = 0;\n        }\n        h->current_mv_x = decode_mv_component(&s->bc, h->current_mv_x);\n        h->current_mv_y = decode_mv_component(&s->bc, h->current_mv_y);\n    } else {\n        h->current_mv_x = 0;\n        h->current_mv_y = 0;\n    }\n    if (HAS_CBP(h->mtype))\n        cbp = bitstream_read_vlc(&s->bc, h261_cbp_vlc.table, H261_CBP_VLC_BITS, 2) + 1;\n    if (s->mb_intra) {\n        s->current_picture.mb_type[xy] = MB_TYPE_INTRA;\n        goto intra;\n    }\n    s->mv_dir                      = MV_DIR_FORWARD;\n    s->mv_type                     = MV_TYPE_16X16;\n    s->current_picture.mb_type[xy] = MB_TYPE_16x16 | MB_TYPE_L0;\n    s->mv[0][0][0]                 = h->current_mv_x * 2;\n    s->mv[0][0][1]                 = h->current_mv_y * 2;\nintra:\n    if (s->mb_intra || HAS_CBP(h->mtype)) {\n        s->bdsp.clear_blocks(s->block[0]);\n        for (i = 0; i < 6; i++) {\n            if (h261_decode_block(h, s->block[i], i, cbp & 32) < 0)\n                return SLICE_ERROR;\n            cbp += cbp;\n        }\n    } else {\n        for (i = 0; i < 6; i++)\n            s->block_last_index[i] = -1;\n    }\n    ff_mpv_decode_mb(s, s->block);\n    return SLICE_OK;\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}']