Commit 5036e214 authored by Michael Niedermayer's avatar Michael Niedermayer

avfilter/vf_zoompan: Free out frame on error

Fixes: CID1398578
Reviewed-by: 's avatarPaul B Mahol <onemda@gmail.com>
Signed-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
parent c217027c
......@@ -191,7 +191,7 @@ static int output_single_frame(AVFilterContext *ctx, AVFrame *in, double *var_va
s->sws = sws_alloc_context();
if (!s->sws) {
ret = AVERROR(ENOMEM);
return ret;
goto error;
}
for (k = 0; in->data[k]; k++)
......@@ -206,7 +206,7 @@ static int output_single_frame(AVFilterContext *ctx, AVFrame *in, double *var_va
av_opt_set_int(s->sws, "sws_flags", SWS_BICUBIC, 0);
if ((ret = sws_init_context(s->sws, NULL, NULL)) < 0)
return ret;
goto error;
sws_scale(s->sws, (const uint8_t *const *)&input, in->linesize, 0, h, out->data, out->linesize);
......@@ -218,6 +218,9 @@ static int output_single_frame(AVFilterContext *ctx, AVFrame *in, double *var_va
s->sws = NULL;
s->current_frame++;
return ret;
error:
av_frame_free(&out);
return ret;
}
static int filter_frame(AVFilterLink *inlink, AVFrame *in)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment