summaryrefslogtreecommitdiff
path: root/libavfilter
diff options
context:
space:
mode:
authorPaul B Mahol <onemda@gmail.com>2016-01-02 21:05:40 +0100
committerPaul B Mahol <onemda@gmail.com>2016-01-07 09:58:55 +0100
commit9f17d4ae7e83e4f4124b28b6aaead61f42ddf223 (patch)
tree0ab7b182fde574a01fcbae997d222bcc192deab2 /libavfilter
parent369b161d8e6d80aa2f4f4d52d8d47e0acd36cbc4 (diff)
avfilter/formats: fix leak of formats on error
Signed-off-by: Paul B Mahol <onemda@gmail.com>
Diffstat (limited to 'libavfilter')
-rw-r--r--libavfilter/formats.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libavfilter/formats.c b/libavfilter/formats.c
index a2b19e7603..f12dcf4783 100644
--- a/libavfilter/formats.c
+++ b/libavfilter/formats.c
@@ -518,6 +518,8 @@ void ff_formats_changeref(AVFilterFormats **oldref, AVFilterFormats **newref)
int ret = ref_fn(fmts, &ctx->inputs[i]->out_fmts); \
if (ret < 0) { \
unref_fn(&fmts); \
+ av_freep(&fmts->list); \
+ av_freep(&fmts); \
return ret; \
} \
count++; \
@@ -528,6 +530,8 @@ void ff_formats_changeref(AVFilterFormats **oldref, AVFilterFormats **newref)
int ret = ref_fn(fmts, &ctx->outputs[i]->in_fmts); \
if (ret < 0) { \
unref_fn(&fmts); \
+ av_freep(&fmts->list); \
+ av_freep(&fmts); \
return ret; \
} \
count++; \