libavcodec/opus_celt.c:2057: error: Integer Overflow L2
  ([0, +oo] - 1):unsigned32 by call to `opus_getrawbits`.

libavcodec/opus_celt.c:2054:5: Call
2052.     celt_decode_allocation   (s, rc);
2053.     celt_decode_fine_energy  (s, rc);
2054.     celt_decode_bands        (s, rc);
          ^
2055. 
2056.     if (s->anticollapse_bit)

libavcodec/opus_celt.c:1879:1: Parameter `rc->rb.cachelen`
  1877. }
  1878. 
  1879. static void celt_decode_bands(CeltContext *s, OpusRangeCoder *rc)
        ^
  1880. {
  1881.     float lowband_scratch[8 * 22];

libavcodec/opus_celt.c:2057:24: Call
2055. 
2056.     if (s->anticollapse_bit)
2057.         anticollapse = opus_getrawbits(rc, 1);
                             ^
2058. 
2059.     celt_decode_final_energy(s, rc, s->framebits - opus_rc_tell(rc));

libavcodec/opus.h:265:1: <LHS trace>
263.  * CELT: read 1-25 raw bits at the end of the frame, backwards byte-wise
264.  */
265. static av_always_inline unsigned int opus_getrawbits(OpusRangeCoder *rc, unsigned int count)
     ^
266. {
267.     unsigned int value = 0;

libavcodec/opus.h:265:1: Parameter `count`
  263.  * CELT: read 1-25 raw bits at the end of the frame, backwards byte-wise
  264.  */
  265. static av_always_inline unsigned int opus_getrawbits(OpusRangeCoder *rc, unsigned int count)
       ^
  266. {
  267.     unsigned int value = 0;

libavcodec/opus.h:265:1: <RHS trace>
263.  * CELT: read 1-25 raw bits at the end of the frame, backwards byte-wise
264.  */
265. static av_always_inline unsigned int opus_getrawbits(OpusRangeCoder *rc, unsigned int count)
     ^
266. {
267.     unsigned int value = 0;

libavcodec/opus.h:265:1: Parameter `count`
  263.  * CELT: read 1-25 raw bits at the end of the frame, backwards byte-wise
  264.  */
  265. static av_always_inline unsigned int opus_getrawbits(OpusRangeCoder *rc, unsigned int count)
       ^
  266. {
  267.     unsigned int value = 0;

libavcodec/opus.h:277:5: Binary operation: ([0, +oo] - 1):unsigned32 by call to `opus_getrawbits` 
  275.     value = rc->rb.cacheval & ((1<<count)-1);
  276.     rc->rb.cacheval    >>= count;
  277.     rc->rb.cachelen     -= count;
           ^
  278.     rc->total_read_bits += count;
  279. 

static av_always_inline unsigned int opus_getrawbits(OpusRangeCoder *rc, unsigned int count)
{
    unsigned int value = 0;
    while (rc->rb.bytes && rc->rb.cachelen < count) {
        rc->rb.cacheval |= *--rc->rb.position << rc->rb.cachelen;
        rc->rb.cachelen += 8;
        rc->rb.bytes--;
    }
    value = rc->rb.cacheval & ((1<<count)-1);
    rc->rb.cacheval    >>= count;
    rc->rb.cachelen     -= count;
    rc->total_read_bits += count;
    return value;
}
['int ff_celt_decode_frame(CeltContext *s, OpusRangeCoder *rc,\n                         float **output, int coded_channels, int frame_size,\n                         int startband,  int endband)\n{\n    int i, j;\n    int consumed;\n    int silence = 0;\n    int transient = 0;\n    int anticollapse = 0;\n    CeltIMDCTContext *imdct;\n    float imdct_scale = 1.0;\n    if (coded_channels != 1 && coded_channels != 2) {\n        av_log(s->avctx, AV_LOG_ERROR, "Invalid number of coded channels: %d\\n",\n               coded_channels);\n        return AVERROR_INVALIDDATA;\n    }\n    if (startband < 0 || startband > endband || endband > CELT_MAX_BANDS) {\n        av_log(s->avctx, AV_LOG_ERROR, "Invalid start/end band: %d %d\\n",\n               startband, endband);\n        return AVERROR_INVALIDDATA;\n    }\n    s->flushed        = 0;\n    s->coded_channels = coded_channels;\n    s->startband      = startband;\n    s->endband        = endband;\n    s->framebits      = rc->rb.bytes * 8;\n    s->duration = av_log2(frame_size / CELT_SHORT_BLOCKSIZE);\n    if (s->duration > CELT_MAX_LOG_BLOCKS ||\n        frame_size != CELT_SHORT_BLOCKSIZE * (1 << s->duration)) {\n        av_log(s->avctx, AV_LOG_ERROR, "Invalid CELT frame size: %d\\n",\n               frame_size);\n        return AVERROR_INVALIDDATA;\n    }\n    if (!s->output_channels)\n        s->output_channels = coded_channels;\n    memset(s->frame[0].collapse_masks, 0, sizeof(s->frame[0].collapse_masks));\n    memset(s->frame[1].collapse_masks, 0, sizeof(s->frame[1].collapse_masks));\n    consumed = opus_rc_tell(rc);\n    if (consumed >= s->framebits)\n        silence = 1;\n    else if (consumed == 1)\n        silence = opus_rc_p2model(rc, 15);\n    if (silence) {\n        consumed = s->framebits;\n        rc->total_read_bits += s->framebits - opus_rc_tell(rc);\n    }\n    consumed = parse_postfilter(s, rc, consumed);\n    if (s->duration != 0 && consumed+3 <= s->framebits)\n        transient = opus_rc_p2model(rc, 3);\n    s->blocks    = transient ? 1 << s->duration : 1;\n    s->blocksize = frame_size / s->blocks;\n    imdct = s->imdct[transient ? 0 : s->duration];\n    if (coded_channels == 1) {\n        for (i = 0; i < CELT_MAX_BANDS; i++)\n            s->frame[0].energy[i] = FFMAX(s->frame[0].energy[i], s->frame[1].energy[i]);\n    }\n    celt_decode_coarse_energy(s, rc);\n    celt_decode_tf_changes   (s, rc, transient);\n    celt_decode_allocation   (s, rc);\n    celt_decode_fine_energy  (s, rc);\n    celt_decode_bands        (s, rc);\n    if (s->anticollapse_bit)\n        anticollapse = opus_getrawbits(rc, 1);\n    celt_decode_final_energy(s, rc, s->framebits - opus_rc_tell(rc));\n    for (i = 0; i < s->coded_channels; i++) {\n        CeltFrame *frame = &s->frame[i];\n        if (anticollapse)\n            process_anticollapse(s, frame, s->coeffs[i]);\n        celt_denormalize(s, frame, s->coeffs[i]);\n    }\n    if (s->output_channels < s->coded_channels) {\n        s->dsp.vector_fmac_scalar(s->coeffs[0], s->coeffs[1], 1.0, FFALIGN(frame_size, 16));\n        imdct_scale = 0.5;\n    } else if (s->output_channels > s->coded_channels)\n        memcpy(s->coeffs[1], s->coeffs[0], frame_size * sizeof(float));\n    if (silence) {\n        for (i = 0; i < 2; i++) {\n            CeltFrame *frame = &s->frame[i];\n            for (j = 0; j < FF_ARRAY_ELEMS(frame->energy); j++)\n                frame->energy[j] = CELT_ENERGY_SILENCE;\n        }\n        memset(s->coeffs, 0, sizeof(s->coeffs));\n    }\n    for (i = 0; i < s->output_channels; i++) {\n        CeltFrame *frame = &s->frame[i];\n        float m = frame->deemph_coeff;\n        for (j = 0; j < s->blocks; j++) {\n            float *dst  = frame->buf + 1024 + j * s->blocksize;\n            ff_celt_imdct_half(imdct, dst + CELT_OVERLAP / 2, s->coeffs[i] + j,\n                               s->blocks, imdct_scale);\n            s->dsp.vector_fmul_window(dst, dst, dst + CELT_OVERLAP / 2,\n                                      celt_window, CELT_OVERLAP / 2);\n        }\n        celt_postfilter(s, frame);\n        for (j = 0; j < frame_size; j++) {\n            float tmp = frame->buf[1024 - frame_size + j] + m;\n            m = tmp * CELT_DEEMPH_COEFF;\n            output[i][j] = tmp / 32768.;\n        }\n        frame->deemph_coeff = m;\n    }\n    if (coded_channels == 1)\n        memcpy(s->frame[1].energy, s->frame[0].energy, sizeof(s->frame[0].energy));\n    for (i = 0; i < 2; i++ ) {\n        CeltFrame *frame = &s->frame[i];\n        if (!transient) {\n            memcpy(frame->prev_energy[1], frame->prev_energy[0], sizeof(frame->prev_energy[0]));\n            memcpy(frame->prev_energy[0], frame->energy,         sizeof(frame->prev_energy[0]));\n        } else {\n            for (j = 0; j < CELT_MAX_BANDS; j++)\n                frame->prev_energy[0][j] = FFMIN(frame->prev_energy[0][j], frame->energy[j]);\n        }\n        for (j = 0; j < s->startband; j++) {\n            frame->prev_energy[0][j] = CELT_ENERGY_SILENCE;\n            frame->energy[j]         = 0.0;\n        }\n        for (j = s->endband; j < CELT_MAX_BANDS; j++) {\n            frame->prev_energy[0][j] = CELT_ENERGY_SILENCE;\n            frame->energy[j]         = 0.0;\n        }\n    }\n    s->seed = rc->range;\n    return 0;\n}', 'static void celt_decode_bands(CeltContext *s, OpusRangeCoder *rc)\n{\n    float lowband_scratch[8 * 22];\n    float norm[2 * 8 * 100];\n    int totalbits = (s->framebits << 3) - s->anticollapse_bit;\n    int update_lowband = 1;\n    int lowband_offset = 0;\n    int i, j;\n    memset(s->coeffs, 0, sizeof(s->coeffs));\n    for (i = s->startband; i < s->endband; i++) {\n        int band_offset = celt_freq_bands[i] << s->duration;\n        int band_size   = celt_freq_range[i] << s->duration;\n        float *X = s->coeffs[0] + band_offset;\n        float *Y = (s->coded_channels == 2) ? s->coeffs[1] + band_offset : NULL;\n        int consumed = opus_rc_tell_frac(rc);\n        float *norm2 = norm + 8 * 100;\n        int effective_lowband = -1;\n        unsigned int cm[2];\n        int b;\n        if (i != s->startband)\n            s->remaining -= consumed;\n        s->remaining2 = totalbits - consumed - 1;\n        if (i <= s->codedbands - 1) {\n            int curr_balance = s->remaining / FFMIN(3, s->codedbands-i);\n            b = av_clip(FFMIN(s->remaining2 + 1, s->pulses[i] + curr_balance), 0, 16383);\n        } else\n            b = 0;\n        if (celt_freq_bands[i] - celt_freq_range[i] >= celt_freq_bands[s->startband] &&\n            (update_lowband || lowband_offset == 0))\n            lowband_offset = i;\n        if (lowband_offset != 0 && (s->spread != CELT_SPREAD_AGGRESSIVE ||\n                                    s->blocks > 1 || s->tf_change[i] < 0)) {\n            int foldstart, foldend;\n            effective_lowband = FFMAX(celt_freq_bands[s->startband],\n                                      celt_freq_bands[lowband_offset] - celt_freq_range[i]);\n            foldstart = lowband_offset;\n            while (celt_freq_bands[--foldstart] > effective_lowband);\n            foldend = lowband_offset - 1;\n            while (celt_freq_bands[++foldend] < effective_lowband + celt_freq_range[i]);\n            cm[0] = cm[1] = 0;\n            for (j = foldstart; j < foldend; j++) {\n                cm[0] |= s->frame[0].collapse_masks[j];\n                cm[1] |= s->frame[s->coded_channels - 1].collapse_masks[j];\n            }\n        } else\n            cm[0] = cm[1] = (1 << s->blocks) - 1;\n        if (s->dualstereo && i == s->intensitystereo) {\n            s->dualstereo = 0;\n            for (j = celt_freq_bands[s->startband] << s->duration; j < band_offset; j++)\n                norm[j] = (norm[j] + norm2[j]) / 2;\n        }\n        if (s->dualstereo) {\n            cm[0] = celt_decode_band(s, rc, i, X, NULL, band_size, b / 2, s->blocks,\n                                     effective_lowband != -1 ? norm + (effective_lowband << s->duration) : NULL, s->duration,\n            norm + band_offset, 0, 1.0f, lowband_scratch, cm[0]);\n            cm[1] = celt_decode_band(s, rc, i, Y, NULL, band_size, b/2, s->blocks,\n                                     effective_lowband != -1 ? norm2 + (effective_lowband << s->duration) : NULL, s->duration,\n            norm2 + band_offset, 0, 1.0f, lowband_scratch, cm[1]);\n        } else {\n            cm[0] = celt_decode_band(s, rc, i, X, Y, band_size, b, s->blocks,\n            effective_lowband != -1 ? norm + (effective_lowband << s->duration) : NULL, s->duration,\n            norm + band_offset, 0, 1.0f, lowband_scratch, cm[0]|cm[1]);\n            cm[1] = cm[0];\n        }\n        s->frame[0].collapse_masks[i]                     = (uint8_t)cm[0];\n        s->frame[s->coded_channels - 1].collapse_masks[i] = (uint8_t)cm[1];\n        s->remaining += s->pulses[i] + consumed;\n        update_lowband = (b > band_size << 3);\n    }\n}', 'static av_always_inline unsigned int opus_getrawbits(OpusRangeCoder *rc, unsigned int count)\n{\n    unsigned int value = 0;\n    while (rc->rb.bytes && rc->rb.cachelen < count) {\n        rc->rb.cacheval |= *--rc->rb.position << rc->rb.cachelen;\n        rc->rb.cachelen += 8;\n        rc->rb.bytes--;\n    }\n    value = rc->rb.cacheval & ((1<<count)-1);\n    rc->rb.cacheval    >>= count;\n    rc->rb.cachelen     -= count;\n    rc->total_read_bits += count;\n    return value;\n}']