[FFmpeg-cvslog] avfilter/formats: fix leak of formats on error

Paul B Mahol git at videolan.org
Thu Jan 7 10:00:37 CET 2016


ffmpeg | branch: master | Paul B Mahol <onemda at gmail.com> | Sat Jan  2 21:05:40 2016 +0100| [9f17d4ae7e83e4f4124b28b6aaead61f42ddf223] | committer: Paul B Mahol

avfilter/formats: fix leak of formats on error

Signed-off-by: Paul B Mahol <onemda at gmail.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=9f17d4ae7e83e4f4124b28b6aaead61f42ddf223
---

 libavfilter/formats.c |    4 ++++
 1 file changed, 4 insertions(+)

diff --git a/libavfilter/formats.c b/libavfilter/formats.c
index a2b19e7..f12dcf4 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++;                                                \



More information about the ffmpeg-cvslog mailing list