static int vp8_alloc_frame(VP8Context *s, AVFrame *f)

{

    int ret;

    if ((ret = ff_thread_get_buffer(s->avctx, f)) < 0)

        return ret;

    if (!s->maps_are_invalid && s->num_maps_to_be_freed) {

        f->ref_index[0] = s->segmentation_maps[--s->num_maps_to_be_freed];

    } else if (!(f->ref_index[0] = av_mallocz(s->mb_width * s->mb_height))) {

        ff_thread_release_buffer(s->avctx, f);

        return AVERROR(ENOMEM);

    }

    return 0;

}

static int vp8_alloc_frame(VP8Context *s, AVFrame *f)

{

    int ret;

    if ((ret = ff_thread_get_buffer(s->avctx, f)) < 0)

        return ret;

    if (!s->maps_are_invalid && s->num_maps_to_be_freed) {

        f->ref_index[0] = s->segmentation_maps[--s->num_maps_to_be_freed];

    } else if (!(f->ref_index[0] = av_mallocz(s->mb_width * s->mb_height))) {

        ff_thread_release_buffer(s->avctx, f);

        return AVERROR(ENOMEM);

    }

    return 0;

}

    if (!s->maps_are_invalid && s->num_maps_to_be_freed) {
static int FUNC_0(VP8Context *VAR_0, AVFrame *VAR_1)

{

    int VAR_2;

    if ((VAR_2 = ff_thread_get_buffer(VAR_0->avctx, VAR_1)) < 0)

        return VAR_2;

    if (!VAR_0->maps_are_invalid && VAR_0->num_maps_to_be_freed) {

        VAR_1->ref_index[0] = VAR_0->segmentation_maps[--VAR_0->num_maps_to_be_freed];

    } else if (!(VAR_1->ref_index[0] = av_mallocz(VAR_0->mb_width * VAR_0->mb_height))) {

        ff_thread_release_buffer(VAR_0->avctx, VAR_1);

        return AVERROR(ENOMEM);

    }

    return 0;

}

static int FUNC_0(VP8Context *VAR_0, AVFrame *VAR_1)
{ int VAR_2; if ((VAR_2 = ff_thread_get_buffer(VAR_0->avctx, VAR_1)) < 0)
return VAR_2; if (!VAR_0->maps_are_invalid && VAR_0->num_maps_to_be_freed) { VAR_1->ref_index[0] = VAR_0->segmentation_maps[--VAR_0->num_maps_to_be_freed]; } else if (!(VAR_1->ref_index[0] = av_mallocz(VAR_0->mb_width * VAR_0->mb_height))) { ff_thread_release_buffer(VAR_0->avctx, VAR_1); return AVERROR(ENOMEM); } return 0; }