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

libavcodec/g722dec.c:112:17: Call
110.         int xout[2];
111. 
112.         ihigh = bitstream_read(&bc, 2);
                     ^
113.         ilow  = bitstream_read(&bc, 6 - skip);
114.         bitstream_skip(&bc, skip);

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 g722_decode_frame(AVCodecContext *avctx, void *data,\n                             int *got_frame_ptr, AVPacket *avpkt)\n{\n    G722Context *c = avctx->priv_data;\n    AVFrame *frame = data;\n    int16_t *out_buf;\n    int j, ret;\n    const int skip = 8 - c->bits_per_codeword;\n    const int16_t *quantizer_table = low_inv_quants[skip];\n    BitstreamContext bc;\n    frame->nb_samples = avpkt->size * 2;\n    if ((ret = ff_get_buffer(avctx, frame, 0)) < 0) {\n        av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\\n");\n        return ret;\n    }\n    out_buf = (int16_t *)frame->data[0];\n    bitstream_init(&bc, avpkt->data, avpkt->size * 8);\n    for (j = 0; j < avpkt->size; j++) {\n        int ilow, ihigh, rlow, rhigh, dhigh;\n        int xout[2];\n        ihigh = bitstream_read(&bc, 2);\n        ilow  = bitstream_read(&bc, 6 - skip);\n        bitstream_skip(&bc, skip);\n        rlow = av_clip_intp2((c->band[0].scale_factor * quantizer_table[ilow] >> 10)\n                      + c->band[0].s_predictor, 14);\n        ff_g722_update_low_predictor(&c->band[0], ilow >> (2 - skip));\n        dhigh = c->band[1].scale_factor * ff_g722_high_inv_quant[ihigh] >> 10;\n        rhigh = av_clip_intp2(dhigh + c->band[1].s_predictor, 14);\n        ff_g722_update_high_predictor(&c->band[1], dhigh, ihigh);\n        c->prev_samples[c->prev_samples_pos++] = rlow + rhigh;\n        c->prev_samples[c->prev_samples_pos++] = rlow - rhigh;\n        c->dsp.apply_qmf(c->prev_samples + c->prev_samples_pos - 24, xout);\n        *out_buf++ = av_clip_int16(xout[0] >> 11);\n        *out_buf++ = av_clip_int16(xout[1] >> 11);\n        if (c->prev_samples_pos >= PREV_SAMPLES_BUF_SIZE) {\n            memmove(c->prev_samples, c->prev_samples + c->prev_samples_pos - 22,\n                    22 * sizeof(c->prev_samples[0]));\n            c->prev_samples_pos = 22;\n        }\n    }\n    *got_frame_ptr = 1;\n    return avpkt->size;\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}']