Commit 00f5c8f9 authored by Michael Niedermayer's avatar Michael Niedermayer

avfilter/vf_zoompan: free out AVFrame on failure

Fixes: CID1197065
Reviewed-by: 's avatarPaul B Mahol <onemda@gmail.com>
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 93b0ee21
...@@ -127,7 +127,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in) ...@@ -127,7 +127,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
ZPContext *s = ctx->priv; ZPContext *s = ctx->priv;
double var_values[VARS_NB], nb_frames, zoom, dx, dy; double var_values[VARS_NB], nb_frames, zoom, dx, dy;
const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(in->format); const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(in->format);
AVFrame *out; AVFrame *out = NULL;
int i, k, x, y, w, h, ret = 0; int i, k, x, y, w, h, ret = 0;
var_values[VAR_IN_W] = var_values[VAR_IW] = in->width; var_values[VAR_IN_W] = var_values[VAR_IW] = in->width;
...@@ -232,6 +232,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in) ...@@ -232,6 +232,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
ret = ff_filter_frame(outlink, out); ret = ff_filter_frame(outlink, out);
if (ret < 0) if (ret < 0)
break; break;
out = NULL;
sws_freeContext(s->sws); sws_freeContext(s->sws);
s->sws = NULL; s->sws = NULL;
...@@ -245,6 +246,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in) ...@@ -245,6 +246,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
fail: fail:
sws_freeContext(s->sws); sws_freeContext(s->sws);
s->sws = NULL; s->sws = NULL;
av_frame_free(&out);
av_frame_free(&in); av_frame_free(&in);
return ret; return ret;
} }
......
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