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

libavcodec/opus_celt.c:636:1: Parameter `s->startband`
634. }
635. 
636. static void celt_decode_allocation(CeltContext *s, OpusRangeCoder *rc)
     ^
637. {
638.     // approx. maximum bit allocation for each band before boost/trim

libavcodec/opus_celt.c:878:27: Call
876.     if (intensitystereo_bit)
877.         s->intensitystereo = s->startband +
878.                           opus_rc_unimodel(rc, s->codedbands + 1 - s->startband);
                               ^
879.     if (s->intensitystereo <= s->startband)
880.         totalbits += dualstereo_bit; /* no intensity stereo means no dual stereo */

libavcodec/opus.h:286:1: <LHS trace>
284.  * CELT: read a uniform distribution
285.  */
286. static av_always_inline unsigned int opus_rc_unimodel(OpusRangeCoder *rc, unsigned int size)
     ^
287. {
288.     unsigned int bits, k, scale, total;

libavcodec/opus.h:286:1: Parameter `size`
  284.  * CELT: read a uniform distribution
  285.  */
  286. static av_always_inline unsigned int opus_rc_unimodel(OpusRangeCoder *rc, unsigned int size)
       ^
  287. {
  288.     unsigned int bits, k, scale, total;

libavcodec/opus.h:290:13: Binary operation: ([0, +oo] - 1):unsigned32 by call to `opus_rc_unimodel` 
  288.     unsigned int bits, k, scale, total;
  289. 
  290.     bits  = opus_ilog(size - 1);
                   ^
  291.     total = (bits > 8) ? ((size - 1) >> (bits - 8)) + 1 : size;
  292. 

static av_always_inline unsigned int opus_rc_unimodel(OpusRangeCoder *rc, unsigned int size)
{
    unsigned int bits, k, scale, total;
    bits  = opus_ilog(size - 1);
    total = (bits > 8) ? ((size - 1) >> (bits - 8)) + 1 : size;
    scale  = rc->range / total;
    k      = rc->value / scale + 1;
    k      = total - FFMIN(k, total);
    opus_rc_update(rc, scale, k, k + 1, total);
    if (bits > 8) {
        k = k << (bits - 8) | opus_getrawbits(rc, bits - 8);
        return FFMIN(k, size - 1);
    } else
        return k;
}
['static void celt_decode_allocation(CeltContext *s, OpusRangeCoder *rc)\n{\n    int cap[CELT_MAX_BANDS];\n    int boost[CELT_MAX_BANDS];\n    int threshold[CELT_MAX_BANDS];\n    int bits1[CELT_MAX_BANDS];\n    int bits2[CELT_MAX_BANDS];\n    int trim_offset[CELT_MAX_BANDS];\n    int skip_startband = s->startband;\n    int dynalloc       = 6;\n    int alloctrim      = 5;\n    int extrabits      = 0;\n    int skip_bit            = 0;\n    int intensitystereo_bit = 0;\n    int dualstereo_bit      = 0;\n    int remaining, bandbits;\n    int low, high, total, done;\n    int totalbits;\n    int consumed;\n    int i, j;\n    consumed = opus_rc_tell(rc);\n    s->spread = CELT_SPREAD_NORMAL;\n    if (consumed + 4 <= s->framebits)\n        s->spread = opus_rc_getsymbol(rc, celt_model_spread);\n    for (i = 0; i < CELT_MAX_BANDS; i++) {\n        cap[i] = (celt_static_caps[s->duration][s->coded_channels - 1][i] + 64)\n                 * celt_freq_range[i] << (s->coded_channels - 1) << s->duration >> 2;\n    }\n    totalbits = s->framebits << 3;\n    consumed = opus_rc_tell_frac(rc);\n    for (i = s->startband; i < s->endband; i++) {\n        int quanta, band_dynalloc;\n        boost[i] = 0;\n        quanta = celt_freq_range[i] << (s->coded_channels - 1) << s->duration;\n        quanta = FFMIN(quanta << 3, FFMAX(6 << 3, quanta));\n        band_dynalloc = dynalloc;\n        while (consumed + (band_dynalloc<<3) < totalbits && boost[i] < cap[i]) {\n            int add = opus_rc_p2model(rc, band_dynalloc);\n            consumed = opus_rc_tell_frac(rc);\n            if (!add)\n                break;\n            boost[i]     += quanta;\n            totalbits    -= quanta;\n            band_dynalloc = 1;\n        }\n        if (boost[i])\n            dynalloc = FFMAX(2, dynalloc - 1);\n    }\n    if (consumed + (6 << 3) <= totalbits)\n        alloctrim = opus_rc_getsymbol(rc, celt_model_alloc_trim);\n    totalbits = (s->framebits << 3) - opus_rc_tell_frac(rc) - 1;\n    s->anticollapse_bit = 0;\n    if (s->blocks > 1 && s->duration >= 2 &&\n        totalbits >= ((s->duration + 2) << 3))\n        s->anticollapse_bit = 1 << 3;\n    totalbits -= s->anticollapse_bit;\n    if (totalbits >= 1 << 3)\n        skip_bit = 1 << 3;\n    totalbits -= skip_bit;\n    if (s->coded_channels == 2) {\n        intensitystereo_bit = celt_log2_frac[s->endband - s->startband];\n        if (intensitystereo_bit <= totalbits) {\n            totalbits -= intensitystereo_bit;\n            if (totalbits >= 1 << 3) {\n                dualstereo_bit = 1 << 3;\n                totalbits -= 1 << 3;\n            }\n        } else\n            intensitystereo_bit = 0;\n    }\n    for (i = s->startband; i < s->endband; i++) {\n        int trim     = alloctrim - 5 - s->duration;\n        int band     = celt_freq_range[i] * (s->endband - i - 1);\n        int duration = s->duration + 3;\n        int scale    = duration + s->coded_channels - 1;\n        threshold[i] = FFMAX(3 * celt_freq_range[i] << duration >> 4,\n                             s->coded_channels << 3);\n        trim_offset[i] = trim * (band << scale) >> 6;\n        if (celt_freq_range[i] << s->duration == 1)\n            trim_offset[i] -= s->coded_channels << 3;\n    }\n    low  = 1;\n    high = CELT_VECTORS - 1;\n    while (low <= high) {\n        int center = (low + high) >> 1;\n        done = total = 0;\n        for (i = s->endband - 1; i >= s->startband; i--) {\n            bandbits = celt_freq_range[i] * celt_static_alloc[center][i]\n                       << (s->coded_channels - 1) << s->duration >> 2;\n            if (bandbits)\n                bandbits = FFMAX(0, bandbits + trim_offset[i]);\n            bandbits += boost[i];\n            if (bandbits >= threshold[i] || done) {\n                done = 1;\n                total += FFMIN(bandbits, cap[i]);\n            } else if (bandbits >= s->coded_channels << 3)\n                total += s->coded_channels << 3;\n        }\n        if (total > totalbits)\n            high = center - 1;\n        else\n            low = center + 1;\n    }\n    high = low--;\n    for (i = s->startband; i < s->endband; i++) {\n        bits1[i] = celt_freq_range[i] * celt_static_alloc[low][i]\n                   << (s->coded_channels - 1) << s->duration >> 2;\n        bits2[i] = high >= CELT_VECTORS ? cap[i] :\n                   celt_freq_range[i] * celt_static_alloc[high][i]\n                   << (s->coded_channels - 1) << s->duration >> 2;\n        if (bits1[i])\n            bits1[i] = FFMAX(0, bits1[i] + trim_offset[i]);\n        if (bits2[i])\n            bits2[i] = FFMAX(0, bits2[i] + trim_offset[i]);\n        if (low)\n            bits1[i] += boost[i];\n        bits2[i] += boost[i];\n        if (boost[i])\n            skip_startband = i;\n        bits2[i] = FFMAX(0, bits2[i] - bits1[i]);\n    }\n    low  = 0;\n    high = 1 << CELT_ALLOC_STEPS;\n    for (i = 0; i < CELT_ALLOC_STEPS; i++) {\n        int center = (low + high) >> 1;\n        done = total = 0;\n        for (j = s->endband - 1; j >= s->startband; j--) {\n            bandbits = bits1[j] + (center * bits2[j] >> CELT_ALLOC_STEPS);\n            if (bandbits >= threshold[j] || done) {\n                done = 1;\n                total += FFMIN(bandbits, cap[j]);\n            } else if (bandbits >= s->coded_channels << 3)\n                total += s->coded_channels << 3;\n        }\n        if (total > totalbits)\n            high = center;\n        else\n            low = center;\n    }\n    done = total = 0;\n    for (i = s->endband - 1; i >= s->startband; i--) {\n        bandbits = bits1[i] + (low * bits2[i] >> CELT_ALLOC_STEPS);\n        if (bandbits >= threshold[i] || done)\n            done = 1;\n        else\n            bandbits = (bandbits >= s->coded_channels << 3) ?\n                       s->coded_channels << 3 : 0;\n        bandbits     = FFMIN(bandbits, cap[i]);\n        s->pulses[i] = bandbits;\n        total      += bandbits;\n    }\n    for (s->codedbands = s->endband; ; s->codedbands--) {\n        int allocation;\n        j = s->codedbands - 1;\n        if (j == skip_startband) {\n            totalbits += skip_bit;\n            break;\n        }\n        remaining   = totalbits - total;\n        bandbits    = remaining / (celt_freq_bands[j+1] - celt_freq_bands[s->startband]);\n        remaining  -= bandbits  * (celt_freq_bands[j+1] - celt_freq_bands[s->startband]);\n        allocation  = s->pulses[j] + bandbits * celt_freq_range[j]\n                      + FFMAX(0, remaining - (celt_freq_bands[j] - celt_freq_bands[s->startband]));\n        if (allocation >= FFMAX(threshold[j], (s->coded_channels + 1) <<3 )) {\n            if (opus_rc_p2model(rc, 1))\n                break;\n            total      += 1 << 3;\n            allocation -= 1 << 3;\n        }\n        total -= s->pulses[j];\n        if (intensitystereo_bit) {\n            total -= intensitystereo_bit;\n            intensitystereo_bit = celt_log2_frac[j - s->startband];\n            total += intensitystereo_bit;\n        }\n        total += s->pulses[j] = (allocation >= s->coded_channels << 3) ?\n                              s->coded_channels << 3 : 0;\n    }\n    s->intensitystereo = 0;\n    s->dualstereo      = 0;\n    if (intensitystereo_bit)\n        s->intensitystereo = s->startband +\n                          opus_rc_unimodel(rc, s->codedbands + 1 - s->startband);\n    if (s->intensitystereo <= s->startband)\n        totalbits += dualstereo_bit;\n    else if (dualstereo_bit)\n        s->dualstereo = opus_rc_p2model(rc, 1);\n    remaining = totalbits - total;\n    bandbits  = remaining / (celt_freq_bands[s->codedbands] - celt_freq_bands[s->startband]);\n    remaining -= bandbits * (celt_freq_bands[s->codedbands] - celt_freq_bands[s->startband]);\n    for (i = s->startband; i < s->codedbands; i++) {\n        int bits = FFMIN(remaining, celt_freq_range[i]);\n        s->pulses[i] += bits + bandbits * celt_freq_range[i];\n        remaining    -= bits;\n    }\n    for (i = s->startband; i < s->codedbands; i++) {\n        int N = celt_freq_range[i] << s->duration;\n        int prev_extra = extrabits;\n        s->pulses[i] += extrabits;\n        if (N > 1) {\n            int dof;\n            int temp;\n            int offset;\n            int fine_bits, max_bits;\n            extrabits = FFMAX(0, s->pulses[i] - cap[i]);\n            s->pulses[i] -= extrabits;\n            dof = N * s->coded_channels\n                  + (s->coded_channels == 2 && N > 2 && !s->dualstereo && i < s->intensitystereo);\n            temp = dof * (celt_log_freq_range[i] + (s->duration<<3));\n            offset = (temp >> 1) - dof * CELT_FINE_OFFSET;\n            if (N == 2)\n                offset += dof<<1;\n            if (s->pulses[i] + offset < 2 * (dof << 3))\n                offset += temp >> 2;\n            else if (s->pulses[i] + offset < 3 * (dof << 3))\n                offset += temp >> 3;\n            fine_bits = (s->pulses[i] + offset + (dof << 2)) / (dof << 3);\n            max_bits  = FFMIN((s->pulses[i]>>3) >> (s->coded_channels - 1),\n                              CELT_MAX_FINE_BITS);\n            max_bits  = FFMAX(max_bits, 0);\n            s->fine_bits[i] = av_clip(fine_bits, 0, max_bits);\n            s->fine_priority[i] = (s->fine_bits[i] * (dof<<3) >= s->pulses[i] + offset);\n            s->pulses[i] -= s->fine_bits[i] << (s->coded_channels - 1) << 3;\n        } else {\n            extrabits = FFMAX(0, s->pulses[i] - (s->coded_channels << 3));\n            s->pulses[i] -= extrabits;\n            s->fine_bits[i] = 0;\n            s->fine_priority[i] = 1;\n        }\n        if (extrabits > 0) {\n            int fineextra = FFMIN(extrabits >> (s->coded_channels + 2),\n                                  CELT_MAX_FINE_BITS - s->fine_bits[i]);\n            s->fine_bits[i] += fineextra;\n            fineextra <<= s->coded_channels + 2;\n            s->fine_priority[i] = (fineextra >= extrabits - prev_extra);\n            extrabits -= fineextra;\n        }\n    }\n    s->remaining = extrabits;\n    for (; i < s->endband; i++) {\n        s->fine_bits[i]     = s->pulses[i] >> (s->coded_channels - 1) >> 3;\n        s->pulses[i]        = 0;\n        s->fine_priority[i] = s->fine_bits[i] < 1;\n    }\n}', 'static av_always_inline unsigned int opus_rc_unimodel(OpusRangeCoder *rc, unsigned int size)\n{\n    unsigned int bits, k, scale, total;\n    bits  = opus_ilog(size - 1);\n    total = (bits > 8) ? ((size - 1) >> (bits - 8)) + 1 : size;\n    scale  = rc->range / total;\n    k      = rc->value / scale + 1;\n    k      = total - FFMIN(k, total);\n    opus_rc_update(rc, scale, k, k + 1, total);\n    if (bits > 8) {\n        k = k << (bits - 8) | opus_getrawbits(rc, bits - 8);\n        return FFMIN(k, size - 1);\n    } else\n        return k;\n}']