libavcodec/g723_1dec.c:78: error: Integer Overflow L2
  (32 - [0, 64]):unsigned32 by call to `bitstream_read`.

libavcodec/g723_1dec.c:75:5: Call
73.     int temp, info_bits, i;
74. 
75.     bitstream_init(&bc, buf, buf_size * 8);
        ^
76. 
77.     /* Extract frame type and rate info */

libavcodec/bitstream.h:85:9: Assignment
  83.         bc->buffer    =
  84.         bc->ptr       = NULL;
  85.         bc->bits_left = 0;
              ^
  86.         return AVERROR_INVALIDDATA;
  87.     }

libavcodec/g723_1dec.c:78:17: Call
76. 
77.     /* Extract frame type and rate info */
78.     info_bits = bitstream_read(&bc, 2);
                    ^
79. 
80.     if (info_bits == 3) {

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:189:9: Call
  187. 
  188.     if (n > bc->bits_left) {
  189.         refill_32(bc);
               ^
  190.         if (bc->bits_left < 32)
  191.             bc->bits_left = n;

libavcodec/bitstream.h:60:1: <RHS trace>
58. }
59. 
60. static inline void refill_32(BitstreamContext *bc)
    ^
61. {
62.     if (bc->ptr >= bc->buffer_end)

libavcodec/bitstream.h:60:1: Parameter `bc->bits_left`
    58. }
    59. 
    60. static inline void refill_32(BitstreamContext *bc)
        ^
    61. {
    62.     if (bc->ptr >= bc->buffer_end)

libavcodec/bitstream.h:68:5: Binary operation: (32 - [0, 64]):unsigned32 by call to `bitstream_read` 
    66.     bc->bits       = (uint64_t)AV_RL32(bc->ptr) << bc->bits_left | bc->bits;
    67. #else
    68.     bc->bits       = bc->bits | (uint64_t)AV_RB32(bc->ptr) << (32 - bc->bits_left);
            ^
    69. #endif
    70.     bc->ptr       += 4;

static inline void refill_32(BitstreamContext *bc)
{
    if (bc->ptr >= bc->buffer_end)
        return;
#ifdef BITSTREAM_READER_LE
    bc->bits       = (uint64_t)AV_RL32(bc->ptr) << bc->bits_left | bc->bits;
#else
    bc->bits       = bc->bits | (uint64_t)AV_RB32(bc->ptr) << (32 - bc->bits_left);
#endif
    bc->ptr       += 4;
    bc->bits_left += 32;
}
['static int unpack_bitstream(G723_1_Context *p, const uint8_t *buf,\n                            int buf_size)\n{\n    BitstreamContext bc;\n    int ad_cb_len;\n    int temp, info_bits, i;\n    bitstream_init(&bc, buf, buf_size * 8);\n    info_bits = bitstream_read(&bc, 2);\n    if (info_bits == 3) {\n        p->cur_frame_type = UNTRANSMITTED_FRAME;\n        return 0;\n    }\n    p->lsp_index[2] = bitstream_read(&bc, 8);\n    p->lsp_index[1] = bitstream_read(&bc, 8);\n    p->lsp_index[0] = bitstream_read(&bc, 8);\n    if (info_bits == 2) {\n        p->cur_frame_type = SID_FRAME;\n        p->subframe[0].amp_index = bitstream_read(&bc, 6);\n        return 0;\n    }\n    p->cur_rate       = info_bits ? RATE_5300 : RATE_6300;\n    p->cur_frame_type = ACTIVE_FRAME;\n    p->pitch_lag[0] = bitstream_read(&bc, 7);\n    if (p->pitch_lag[0] > 123)\n        return -1;\n    p->pitch_lag[0] += PITCH_MIN;\n    p->subframe[1].ad_cb_lag = bitstream_read(&bc, 2);\n    p->pitch_lag[1] = bitstream_read(&bc, 7);\n    if (p->pitch_lag[1] > 123)\n        return -1;\n    p->pitch_lag[1] += PITCH_MIN;\n    p->subframe[3].ad_cb_lag = bitstream_read(&bc, 2);\n    p->subframe[0].ad_cb_lag = 1;\n    p->subframe[2].ad_cb_lag = 1;\n    for (i = 0; i < SUBFRAMES; i++) {\n        temp = bitstream_read(&bc, 12);\n        ad_cb_len = 170;\n        p->subframe[i].dirac_train = 0;\n        if (p->cur_rate == RATE_6300 && p->pitch_lag[i >> 1] < SUBFRAME_LEN - 2) {\n            p->subframe[i].dirac_train = temp >> 11;\n            temp &= 0x7FF;\n            ad_cb_len = 85;\n        }\n        p->subframe[i].ad_cb_gain = FASTDIV(temp, GAIN_LEVELS);\n        if (p->subframe[i].ad_cb_gain < ad_cb_len) {\n            p->subframe[i].amp_index = temp - p->subframe[i].ad_cb_gain *\n                                       GAIN_LEVELS;\n        } else {\n            return -1;\n        }\n    }\n    p->subframe[0].grid_index = bitstream_read(&bc, 1);\n    p->subframe[1].grid_index = bitstream_read(&bc, 1);\n    p->subframe[2].grid_index = bitstream_read(&bc, 1);\n    p->subframe[3].grid_index = bitstream_read(&bc, 1);\n    if (p->cur_rate == RATE_6300) {\n        bitstream_skip(&bc, 1);\n        temp = bitstream_read(&bc, 13);\n        p->subframe[0].pulse_pos = temp / 810;\n        temp -= p->subframe[0].pulse_pos * 810;\n        p->subframe[1].pulse_pos = FASTDIV(temp, 90);\n        temp -= p->subframe[1].pulse_pos * 90;\n        p->subframe[2].pulse_pos = FASTDIV(temp, 9);\n        p->subframe[3].pulse_pos = temp - p->subframe[2].pulse_pos * 9;\n        p->subframe[0].pulse_pos = (p->subframe[0].pulse_pos << 16) +\n                                   bitstream_read(&bc, 16);\n        p->subframe[1].pulse_pos = (p->subframe[1].pulse_pos << 14) +\n                                   bitstream_read(&bc, 14);\n        p->subframe[2].pulse_pos = (p->subframe[2].pulse_pos << 16) +\n                                   bitstream_read(&bc, 16);\n        p->subframe[3].pulse_pos = (p->subframe[3].pulse_pos << 14) +\n                                   bitstream_read(&bc, 14);\n        p->subframe[0].pulse_sign = bitstream_read(&bc, 6);\n        p->subframe[1].pulse_sign = bitstream_read(&bc, 5);\n        p->subframe[2].pulse_sign = bitstream_read(&bc, 6);\n        p->subframe[3].pulse_sign = bitstream_read(&bc, 5);\n    } else {\n        p->subframe[0].pulse_pos  = bitstream_read(&bc, 12);\n        p->subframe[1].pulse_pos  = bitstream_read(&bc, 12);\n        p->subframe[2].pulse_pos  = bitstream_read(&bc, 12);\n        p->subframe[3].pulse_pos  = bitstream_read(&bc, 12);\n        p->subframe[0].pulse_sign = bitstream_read(&bc, 4);\n        p->subframe[1].pulse_sign = bitstream_read(&bc, 4);\n        p->subframe[2].pulse_sign = bitstream_read(&bc, 4);\n        p->subframe[3].pulse_sign = bitstream_read(&bc, 4);\n    }\n    return 0;\n}', 'static inline int bitstream_init(BitstreamContext *bc, const uint8_t *buffer,\n                                 unsigned bit_size)\n{\n    unsigned buffer_size;\n    if (bit_size > INT_MAX - 7 || !buffer) {\n        buffer        =\n        bc->buffer    =\n        bc->ptr       = NULL;\n        bc->bits_left = 0;\n        return AVERROR_INVALIDDATA;\n    }\n    buffer_size = (bit_size + 7) >> 3;\n    bc->buffer       = buffer;\n    bc->buffer_end   = buffer + buffer_size;\n    bc->ptr          = bc->buffer;\n    bc->size_in_bits = bit_size;\n    bc->bits_left    = 0;\n    bc->bits         = 0;\n    refill_64(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 void refill_32(BitstreamContext *bc)\n{\n    if (bc->ptr >= bc->buffer_end)\n        return;\n#ifdef BITSTREAM_READER_LE\n    bc->bits       = (uint64_t)AV_RL32(bc->ptr) << bc->bits_left | bc->bits;\n#else\n    bc->bits       = bc->bits | (uint64_t)AV_RB32(bc->ptr) << (32 - bc->bits_left);\n#endif\n    bc->ptr       += 4;\n    bc->bits_left += 32;\n}']