static int allocate_buffers(ShortenContext *s)

{

    int i, chan, err;



    for (chan = 0; chan < s->channels; chan++) {

        if (FFMAX(1, s->nmean) >= UINT_MAX / sizeof(int32_t)) {

            av_log(s->avctx, AV_LOG_ERROR, "nmean too large\n");

            return AVERROR_INVALIDDATA;

        }

        if (s->blocksize + s->nwrap >= UINT_MAX / sizeof(int32_t) ||

            s->blocksize + s->nwrap <= (unsigned)s->nwrap) {

            av_log(s->avctx, AV_LOG_ERROR,

                   "s->blocksize + s->nwrap too large\n");

            return AVERROR_INVALIDDATA;

        }



        if ((err = av_reallocp_array(&s->offset[chan],

                               sizeof(int32_t),

                               FFMAX(1, s->nmean))) < 0)

            return err;



        if ((err = av_reallocp_array(&s->decoded_base[chan], (s->blocksize + s->nwrap),

                               sizeof(s->decoded_base[0][0]))) < 0)

            return err;

        for (i = 0; i < s->nwrap; i++)

            s->decoded_base[chan][i] = 0;

        s->decoded[chan] = s->decoded_base[chan] + s->nwrap;

    }



    if ((err = av_reallocp_array(&s->coeffs, s->nwrap, sizeof(*s->coeffs))) < 0)

        return err;



    return 0;

}

static int allocate_buffers(ShortenContext *s)

{

    int i, chan, err;



    for (chan = 0; chan < s->channels; chan++) {

        if (FFMAX(1, s->nmean) >= UINT_MAX / sizeof(int32_t)) {

            av_log(s->avctx, AV_LOG_ERROR, "nmean too large\n");

            return AVERROR_INVALIDDATA;

        }

        if (s->blocksize + s->nwrap >= UINT_MAX / sizeof(int32_t) ||

            s->blocksize + s->nwrap <= (unsigned)s->nwrap) {

            av_log(s->avctx, AV_LOG_ERROR,

                   "s->blocksize + s->nwrap too large\n");

            return AVERROR_INVALIDDATA;

        }



        if ((err = av_reallocp_array(&s->offset[chan],

                               sizeof(int32_t),

                               FFMAX(1, s->nmean))) < 0)

            return err;



        if ((err = av_reallocp_array(&s->decoded_base[chan], (s->blocksize + s->nwrap),

                               sizeof(s->decoded_base[0][0]))) < 0)

            return err;

        for (i = 0; i < s->nwrap; i++)

            s->decoded_base[chan][i] = 0;

        s->decoded[chan] = s->decoded_base[chan] + s->nwrap;

    }



    if ((err = av_reallocp_array(&s->coeffs, s->nwrap, sizeof(*s->coeffs))) < 0)

        return err;



    return 0;

}

        if (s->blocksize + s->nwrap >= UINT_MAX / sizeof(int32_t) ||             s->blocksize + s->nwrap <= (unsigned)s->nwrap) {
static int FUNC_0(ShortenContext *VAR_0)

{

    int VAR_1, VAR_2, VAR_3;



    for (VAR_2 = 0; VAR_2 < VAR_0->channels; VAR_2++) {

        if (FFMAX(1, VAR_0->nmean) >= UINT_MAX / sizeof(int32_t)) {

            av_log(VAR_0->avctx, AV_LOG_ERROR, "nmean too large\n");

            return AVERROR_INVALIDDATA;

        }

        if (VAR_0->blocksize + VAR_0->nwrap >= UINT_MAX / sizeof(int32_t) ||

            VAR_0->blocksize + VAR_0->nwrap <= (unsigned)VAR_0->nwrap) {

            av_log(VAR_0->avctx, AV_LOG_ERROR,

                   "VAR_0->blocksize + VAR_0->nwrap too large\n");

            return AVERROR_INVALIDDATA;

        }



        if ((VAR_3 = av_reallocp_array(&VAR_0->offset[VAR_2],

                               sizeof(int32_t),

                               FFMAX(1, VAR_0->nmean))) < 0)

            return VAR_3;



        if ((VAR_3 = av_reallocp_array(&VAR_0->decoded_base[VAR_2], (VAR_0->blocksize + VAR_0->nwrap),

                               sizeof(VAR_0->decoded_base[0][0]))) < 0)

            return VAR_3;

        for (VAR_1 = 0; VAR_1 < VAR_0->nwrap; VAR_1++)

            VAR_0->decoded_base[VAR_2][VAR_1] = 0;

        VAR_0->decoded[VAR_2] = VAR_0->decoded_base[VAR_2] + VAR_0->nwrap;

    }



    if ((VAR_3 = av_reallocp_array(&VAR_0->coeffs, VAR_0->nwrap, sizeof(*VAR_0->coeffs))) < 0)

        return VAR_3;



    return 0;

}

static int FUNC_0(ShortenContext *VAR_0)
{ int VAR_1, VAR_2, VAR_3; for (VAR_2 = 0; VAR_2 < VAR_0->channels; VAR_2++) { if (FFMAX(1, VAR_0->nmean) >= UINT_MAX / sizeof(int32_t)) { av_log(VAR_0->avctx, AV_LOG_ERROR, "nmean too large\n"); return AVERROR_INVALIDDATA; } if (VAR_0->blocksize + VAR_0->nwrap >= UINT_MAX / sizeof(int32_t) ||
VAR_0->blocksize + VAR_0->nwrap <= (unsigned)VAR_0->nwrap) { av_log(VAR_0->avctx, AV_LOG_ERROR,
"VAR_0->blocksize + VAR_0->nwrap too large\n"); return AVERROR_INVALIDDATA; } if ((VAR_3 = av_reallocp_array(&VAR_0->offset[VAR_2],
sizeof(int32_t),
FFMAX(1, VAR_0->nmean))) < 0)
return VAR_3; if ((VAR_3 = av_reallocp_array(&VAR_0->decoded_base[VAR_2], (VAR_0->blocksize + VAR_0->nwrap),
sizeof(VAR_0->decoded_base[0][0]))) < 0)
return VAR_3; for (VAR_1 = 0; VAR_1 < VAR_0->nwrap; VAR_1++) VAR_0->decoded_base[VAR_2][VAR_1] = 0; VAR_0->decoded[VAR_2] = VAR_0->decoded_base[VAR_2] + VAR_0->nwrap; } if ((VAR_3 = av_reallocp_array(&VAR_0->coeffs, VAR_0->nwrap, sizeof(*VAR_0->coeffs))) < 0)
return VAR_3; return 0; }