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

libavcodec/apedec.c:652:1: Parameter `ctx->riceY.k`
650. }
651. 
652. static void entropy_decode_stereo_3860(APEContext *ctx, int blockstodecode)
     ^
653. {
654.     int32_t *decoded0 = ctx->decoded[0];

libavcodec/apedec.c:659:23: Call
657. 
658.     while (blockstodecode--)
659.         *decoded0++ = ape_decode_value_3860(ctx, &ctx->gb, &ctx->riceY);
                           ^
660.     while (blocks--)
661.         *decoded1++ = ape_decode_value_3860(ctx, &ctx->gb, &ctx->riceX);

libavcodec/apedec.c:475:1: <LHS trace>
473. }
474. 
475. static inline int ape_decode_value_3860(APEContext *ctx, GetBitContext *gb,
     ^
476.                                         APERice *rice)
477. {

libavcodec/apedec.c:475:1: Parameter `rice->k`
  473. }
  474. 
  475. static inline int ape_decode_value_3860(APEContext *ctx, GetBitContext *gb,
       ^
  476.                                         APERice *rice)
  477. {

libavcodec/apedec.c:496:9: Binary operation: ([0, +oo] - 1):unsigned32 by call to `ape_decode_value_3860` 
  494.     rice->ksum += x - (rice->ksum + 8 >> 4);
  495.     if (rice->ksum < (rice->k ? 1 << (rice->k + 4) : 0))
  496.         rice->k--;
               ^
  497.     else if (rice->ksum >= (1 << (rice->k + 5)) && rice->k < 24)
  498.         rice->k++;

static inline int ape_decode_value_3860(APEContext *ctx, GetBitContext *gb,
                                        APERice *rice)
{
    unsigned int x, overflow;
    overflow = get_unary(gb, 1, get_bits_left(gb));
    if (ctx->fileversion > 3880) {
        while (overflow >= 16) {
            overflow -= 16;
            rice->k  += 4;
        }
    }
    if (!rice->k)
        x = overflow;
    else
        x = (overflow << rice->k) + get_bits(gb, rice->k);
    rice->ksum += x - (rice->ksum + 8 >> 4);
    if (rice->ksum < (rice->k ? 1 << (rice->k + 4) : 0))
        rice->k--;
    else if (rice->ksum >= (1 << (rice->k + 5)) && rice->k < 24)
        rice->k++;
    if (x & 1)
        return (x >> 1) + 1;
    else
        return -(x >> 1);
}
['static void entropy_decode_stereo_3860(APEContext *ctx, int blockstodecode)\n{\n    int32_t *decoded0 = ctx->decoded[0];\n    int32_t *decoded1 = ctx->decoded[1];\n    int blocks = blockstodecode;\n    while (blockstodecode--)\n        *decoded0++ = ape_decode_value_3860(ctx, &ctx->gb, &ctx->riceY);\n    while (blocks--)\n        *decoded1++ = ape_decode_value_3860(ctx, &ctx->gb, &ctx->riceX);\n}', 'static inline int ape_decode_value_3860(APEContext *ctx, GetBitContext *gb,\n                                        APERice *rice)\n{\n    unsigned int x, overflow;\n    overflow = get_unary(gb, 1, get_bits_left(gb));\n    if (ctx->fileversion > 3880) {\n        while (overflow >= 16) {\n            overflow -= 16;\n            rice->k  += 4;\n        }\n    }\n    if (!rice->k)\n        x = overflow;\n    else\n        x = (overflow << rice->k) + get_bits(gb, rice->k);\n    rice->ksum += x - (rice->ksum + 8 >> 4);\n    if (rice->ksum < (rice->k ? 1 << (rice->k + 4) : 0))\n        rice->k--;\n    else if (rice->ksum >= (1 << (rice->k + 5)) && rice->k < 24)\n        rice->k++;\n    if (x & 1)\n        return (x >> 1) + 1;\n    else\n        return -(x >> 1);\n}']