static int allocate_buffers(ALACContext *alac)

{

    int ch;

    int buf_size = alac->max_samples_per_frame * sizeof(int32_t);



    for (ch = 0; ch < FFMIN(alac->channels, 2); ch++) {

        FF_ALLOC_OR_GOTO(alac->avctx, alac->predict_error_buffer[ch],

                         buf_size, buf_alloc_fail);



        alac->direct_output = alac->sample_size > 16 && av_sample_fmt_is_planar(alac->avctx->sample_fmt);

        if (!alac->direct_output) {

            FF_ALLOC_OR_GOTO(alac->avctx, alac->output_samples_buffer[ch],

                             buf_size, buf_alloc_fail);

        }



        FF_ALLOC_OR_GOTO(alac->avctx, alac->extra_bits_buffer[ch],

                         buf_size, buf_alloc_fail);

    }

    return 0;

buf_alloc_fail:

    alac_decode_close(alac->avctx);

    return AVERROR(ENOMEM);

}

static int allocate_buffers(ALACContext *alac)

{

    int ch;

    int buf_size = alac->max_samples_per_frame * sizeof(int32_t);



    for (ch = 0; ch < FFMIN(alac->channels, 2); ch++) {

        FF_ALLOC_OR_GOTO(alac->avctx, alac->predict_error_buffer[ch],

                         buf_size, buf_alloc_fail);



        alac->direct_output = alac->sample_size > 16 && av_sample_fmt_is_planar(alac->avctx->sample_fmt);

        if (!alac->direct_output) {

            FF_ALLOC_OR_GOTO(alac->avctx, alac->output_samples_buffer[ch],

                             buf_size, buf_alloc_fail);

        }



        FF_ALLOC_OR_GOTO(alac->avctx, alac->extra_bits_buffer[ch],

                         buf_size, buf_alloc_fail);

    }

    return 0;

buf_alloc_fail:

    alac_decode_close(alac->avctx);

    return AVERROR(ENOMEM);

}

    int buf_size = alac->max_samples_per_frame * sizeof(int32_t);
static int FUNC_0(ALACContext *VAR_0)

{

    int VAR_1;

    int VAR_2 = VAR_0->max_samples_per_frame * sizeof(int32_t);



    for (VAR_1 = 0; VAR_1 < FFMIN(VAR_0->channels, 2); VAR_1++) {

        FF_ALLOC_OR_GOTO(VAR_0->avctx, VAR_0->predict_error_buffer[VAR_1],

                         VAR_2, buf_alloc_fail);



        VAR_0->direct_output = VAR_0->sample_size > 16 && av_sample_fmt_is_planar(VAR_0->avctx->sample_fmt);

        if (!VAR_0->direct_output) {

            FF_ALLOC_OR_GOTO(VAR_0->avctx, VAR_0->output_samples_buffer[VAR_1],

                             VAR_2, buf_alloc_fail);

        }



        FF_ALLOC_OR_GOTO(VAR_0->avctx, VAR_0->extra_bits_buffer[VAR_1],

                         VAR_2, buf_alloc_fail);

    }

    return 0;

buf_alloc_fail:

    alac_decode_close(VAR_0->avctx);

    return AVERROR(ENOMEM);

}

static int FUNC_0(ALACContext *VAR_0)
{ int VAR_1; int VAR_2 = VAR_0->max_samples_per_frame * sizeof(int32_t); for (VAR_1 = 0; VAR_1 < FFMIN(VAR_0->channels, 2); VAR_1++) { FF_ALLOC_OR_GOTO(VAR_0->avctx, VAR_0->predict_error_buffer[VAR_1],
VAR_2, buf_alloc_fail); VAR_0->direct_output = VAR_0->sample_size > 16 && av_sample_fmt_is_planar(VAR_0->avctx->sample_fmt); if (!VAR_0->direct_output) { FF_ALLOC_OR_GOTO(VAR_0->avctx, VAR_0->output_samples_buffer[VAR_1],
VAR_2, buf_alloc_fail); } FF_ALLOC_OR_GOTO(VAR_0->avctx, VAR_0->extra_bits_buffer[VAR_1],
VAR_2, buf_alloc_fail); } return 0; buf_alloc_fail:
alac_decode_close(VAR_0->avctx); return AVERROR(ENOMEM); }