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

libavcodec/apedec.c:529:1: Parameter `ctx->riceY.k`
527. }
528. 
529. static void entropy_decode_mono_3990(APEContext *ctx, int blockstodecode)
     ^
530. {
531.     int32_t *decoded0 = ctx->decoded[0];

libavcodec/apedec.c:534:23: Call
532. 
533.     while (blockstodecode--)
534.         *decoded0++ = ape_decode_value_3990(ctx, &ctx->riceY);
                           ^
535. }
536. 

libavcodec/apedec.c:464:1: Parameter `rice->k`
  462. }
  463. 
  464. static inline int ape_decode_value_3990(APEContext *ctx, APERice *rice)
       ^
  465. {
  466.     unsigned int x, overflow;

libavcodec/apedec.c:501:5: Call
  499.     x = base + overflow * pivot;
  500. 
  501.     update_rice(rice, x);
           ^
  502. 
  503.     /* 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_3990` 
    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_mono_3990(APEContext *ctx, int blockstodecode)\n{\n    int32_t *decoded0 = ctx->decoded[0];\n    while (blockstodecode--)\n        *decoded0++ = ape_decode_value_3990(ctx, &ctx->riceY);\n}', 'static inline int ape_decode_value_3990(APEContext *ctx, APERice *rice)\n{\n    unsigned int x, overflow;\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    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}']