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

libavcodec/apedec.c:518:1: Parameter `ctx->riceY.k`
516. }
517. 
518. static void entropy_decode_stereo_3900(APEContext *ctx, int blockstodecode)
     ^
519. {
520.     int32_t *decoded0 = ctx->decoded[0];

libavcodec/apedec.c:524:23: Call
522. 
523.     while (blockstodecode--) {
524.         *decoded0++ = ape_decode_value_3900(ctx, &ctx->riceY);
                           ^
525.         *decoded1++ = ape_decode_value_3900(ctx, &ctx->riceX);
526.     }

libavcodec/apedec.c:431:1: Parameter `rice->k`
  429. }
  430. 
  431. static inline int ape_decode_value_3900(APEContext *ctx, APERice *rice)
       ^
  432. {
  433.     unsigned int x, overflow;

libavcodec/apedec.c:455:5: Call
  453.     x += overflow << tmpk;
  454. 
  455.     update_rice(rice, x);
           ^
  456. 
  457.     /* Convert to signed */

libavcodec/apedec.c:420:1: <LHS trace>
418. /** @} */ // group rangecoder
419. 
420. static inline void update_rice(APERice *rice, unsigned int x)
     ^
421. {
422.     int lim = rice->k ? (1 << (rice->k + 4)) : 0;

libavcodec/apedec.c:420:1: Parameter `rice->k`
    418. /** @} */ // group rangecoder
    419. 
    420. static inline void update_rice(APERice *rice, unsigned int x)
         ^
    421. {
    422.     int lim = rice->k ? (1 << (rice->k + 4)) : 0;

libavcodec/apedec.c:426:9: Binary operation: ([0, +oo] - 1):unsigned32 by call to `ape_decode_value_3900` 
    424. 
    425.     if (rice->ksum < lim)
    426.         rice->k--;
                 ^
    427.     else if (rice->ksum >= (1 << (rice->k + 5)))
    428.         rice->k++;

static inline void update_rice(APERice *rice, unsigned int x)
{
    int lim = rice->k ? (1 << (rice->k + 4)) : 0;
    rice->ksum += ((x + 1) / 2) - ((rice->ksum + 16) >> 5);
    if (rice->ksum < lim)
        rice->k--;
    else if (rice->ksum >= (1 << (rice->k + 5)))
        rice->k++;
}
['static void entropy_decode_stereo_3900(APEContext *ctx, int blockstodecode)\n{\n    int32_t *decoded0 = ctx->decoded[0];\n    int32_t *decoded1 = ctx->decoded[1];\n    while (blockstodecode--) {\n        *decoded0++ = ape_decode_value_3900(ctx, &ctx->riceY);\n        *decoded1++ = ape_decode_value_3900(ctx, &ctx->riceX);\n    }\n}', 'static inline int ape_decode_value_3900(APEContext *ctx, APERice *rice)\n{\n    unsigned int x, overflow;\n    int tmpk;\n    overflow = range_get_symbol(ctx, counts_3970, counts_diff_3970);\n    if (overflow == (MODEL_ELEMENTS - 1)) {\n        tmpk = range_decode_bits(ctx, 5);\n        overflow = 0;\n    } else\n        tmpk = (rice->k < 1) ? 0 : rice->k - 1;\n    if (tmpk <= 16)\n        x = range_decode_bits(ctx, tmpk);\n    else if (tmpk <= 32) {\n        x = range_decode_bits(ctx, 16);\n        x |= (range_decode_bits(ctx, tmpk - 16) << 16);\n    } else {\n        av_log(ctx->avctx, AV_LOG_ERROR, "Too many bits: %d\\n", tmpk);\n        return AVERROR_INVALIDDATA;\n    }\n    x += overflow << tmpk;\n    update_rice(rice, x);\n    if (x & 1)\n        return (x >> 1) + 1;\n    else\n        return -(x >> 1);\n}', 'static inline void update_rice(APERice *rice, unsigned int x)\n{\n    int lim = rice->k ? (1 << (rice->k + 4)) : 0;\n    rice->ksum += ((x + 1) / 2) - ((rice->ksum + 16) >> 5);\n    if (rice->ksum < lim)\n        rice->k--;\n    else if (rice->ksum >= (1 << (rice->k + 5)))\n        rice->k++;\n}']