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

libavcodec/apedec.c:669:1: Parameter `ctx->riceY.k`
667. }
668. 
669. static void entropy_decode_mono_3860(APEContext *ctx, int blockstodecode)
     ^
670. {
671.     int32_t *decoded0 = ctx->decoded[0];

libavcodec/apedec.c:674:23: Call
672. 
673.     while (blockstodecode--)
674.         *decoded0++ = ape_decode_value_3860(ctx, &ctx->bc, &ctx->riceY);
                           ^
675. }
676. 

libavcodec/apedec.c:500:1: <LHS trace>
498. }
499. 
500. static inline int ape_decode_value_3860(APEContext *ctx, BitstreamContext *bc,
     ^
501.                                         APERice *rice)
502. {

libavcodec/apedec.c:500:1: Parameter `rice->k`
  498. }
  499. 
  500. static inline int ape_decode_value_3860(APEContext *ctx, BitstreamContext *bc,
       ^
  501.                                         APERice *rice)
  502. {

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

static inline int ape_decode_value_3860(APEContext *ctx, BitstreamContext *bc,
                                        APERice *rice)
{
    unsigned int x, overflow;
    overflow = get_unary(bc, 1, bitstream_bits_left(bc));
    if (ctx->fileversion > 3880) {
        while (overflow >= 16) {
            overflow -= 16;
            rice->k  += 4;
        }
    }
    if (!rice->k)
        x = overflow;
    else
        x = (overflow << rice->k) + bitstream_read(bc, 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_mono_3860(APEContext *ctx, int blockstodecode)\n{\n    int32_t *decoded0 = ctx->decoded[0];\n    while (blockstodecode--)\n        *decoded0++ = ape_decode_value_3860(ctx, &ctx->bc, &ctx->riceY);\n}', 'static inline int ape_decode_value_3860(APEContext *ctx, BitstreamContext *bc,\n                                        APERice *rice)\n{\n    unsigned int x, overflow;\n    overflow = get_unary(bc, 1, bitstream_bits_left(bc));\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) + bitstream_read(bc, 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}']