summaryrefslogtreecommitdiffstats
path: root/libavfilter
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2017-03-30 23:34:48 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2017-03-31 12:28:58 +0200
commit5036e214b0e1028e035d628f7e7f89cb1ba6a0d6 (patch)
tree71abcd60c88111d354d66cf09dde83e1d2ce373b /libavfilter
parentc217027c1173668c13b243c42e9b7c9d21c64170 (diff)
downloadffmpeg-streaming-5036e214b0e1028e035d628f7e7f89cb1ba6a0d6.zip
ffmpeg-streaming-5036e214b0e1028e035d628f7e7f89cb1ba6a0d6.tar.gz
avfilter/vf_zoompan: Free out frame on error
Fixes: CID1398578 Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavfilter')
-rw-r--r--libavfilter/vf_zoompan.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/libavfilter/vf_zoompan.c b/libavfilter/vf_zoompan.c
index 136d6c8..53a0700 100644
--- a/libavfilter/vf_zoompan.c
+++ b/libavfilter/vf_zoompan.c
@@ -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)
OpenPOWER on IntegriCloud