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

libavcodec/apedec.c:451:1: Parameter `ctx->riceY.k`
449. }
450. 
451. static void entropy_decode(APEContext *ctx, int blockstodecode, int stereo)
     ^
452. {
453.     int32_t *decoded0 = ctx->decoded0;

libavcodec/apedec.c:464:27: Call
462.     } else {
463.         while (blockstodecode--) {
464.             *decoded0++ = ape_decode_value(ctx, &ctx->riceY);
                               ^
465.             if (stereo)
466.                 *decoded1++ = ape_decode_value(ctx, &ctx->riceX);

libavcodec/apedec.c:384:1: Parameter `rice->k`
  382. }
  383. 
  384. static inline int ape_decode_value(APEContext *ctx, APERice *rice)
       ^
  385. {
  386.     int x, overflow;

libavcodec/apedec.c:442:5: Call
  440.     }
  441. 
  442.     update_rice(rice, x);
           ^
  443. 
  444.     /* Convert to signed */

libavcodec/apedec.c:373:1: <LHS trace>
371. /** @} */ // group rangecoder
372. 
373. static inline void update_rice(APERice *rice, int x)
     ^
374. {
375.     int lim = rice->k ? (1 << (rice->k + 4)) : 0;

libavcodec/apedec.c:373:1: Parameter `rice->k`
    371. /** @} */ // group rangecoder
    372. 
    373. static inline void update_rice(APERice *rice, int x)
         ^
    374. {
    375.     int lim = rice->k ? (1 << (rice->k + 4)) : 0;

libavcodec/apedec.c:379:9: Binary operation: ([0, +oo] - 1):unsigned32 by call to `ape_decode_value` 
    377. 
    378.     if (rice->ksum < lim)
    379.         rice->k--;
                 ^
    380.     else if (rice->ksum >= (1 << (rice->k + 5)))
    381.         rice->k++;

static inline void update_rice(APERice *rice, 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(APEContext *ctx, int blockstodecode, int stereo)\n{\n    int32_t *decoded0 = ctx->decoded0;\n    int32_t *decoded1 = ctx->decoded1;\n    ctx->blocksdecoded = blockstodecode;\n    if (ctx->frameflags & APE_FRAMECODE_STEREO_SILENCE) {\n        memset(decoded0, 0, blockstodecode * sizeof(int32_t));\n        memset(decoded1, 0, blockstodecode * sizeof(int32_t));\n    } else {\n        while (blockstodecode--) {\n            *decoded0++ = ape_decode_value(ctx, &ctx->riceY);\n            if (stereo)\n                *decoded1++ = ape_decode_value(ctx, &ctx->riceX);\n        }\n    }\n    if (ctx->blocksdecoded == ctx->currentframeblocks)\n        range_dec_normalize(ctx);\n}', 'static inline int ape_decode_value(APEContext *ctx, APERice *rice)\n{\n    int x, overflow;\n    if (ctx->fileversion < 3990) {\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 {\n            x = range_decode_bits(ctx, 16);\n            x |= (range_decode_bits(ctx, tmpk - 16) << 16);\n        }\n        x += overflow << tmpk;\n    } else {\n        int base, pivot;\n        pivot = rice->ksum >> 5;\n        if (pivot == 0)\n            pivot = 1;\n        overflow = range_get_symbol(ctx, counts_3980, counts_diff_3980);\n        if (overflow == (MODEL_ELEMENTS - 1)) {\n            overflow  = range_decode_bits(ctx, 16) << 16;\n            overflow |= range_decode_bits(ctx, 16);\n        }\n        if (pivot < 0x10000) {\n            base = range_decode_culfreq(ctx, pivot);\n            range_decode_update(ctx, 1, base);\n        } else {\n            int base_hi = pivot, base_lo;\n            int bbits = 0;\n            while (base_hi & ~0xFFFF) {\n                base_hi >>= 1;\n                bbits++;\n            }\n            base_hi = range_decode_culfreq(ctx, base_hi + 1);\n            range_decode_update(ctx, 1, base_hi);\n            base_lo = range_decode_culfreq(ctx, 1 << bbits);\n            range_decode_update(ctx, 1, base_lo);\n            base = (base_hi << bbits) + base_lo;\n        }\n        x = base + overflow * pivot;\n    }\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, 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}']