[FFmpeg-cvslog] ffmpeg: Clean up if filter initialisation failed to avoid a memleak.

Carl Eugen Hoyos git at videolan.org
Sat Aug 30 14:47:29 CEST 2014


ffmpeg | branch: master | Carl Eugen Hoyos <cehoyos at ag.or.at> | Sat Aug 30 12:27:50 2014 +0200| [494cbc4238db4db1f3bd2104e15bee4498b40cb4] | committer: Carl Eugen Hoyos

ffmpeg: Clean up if filter initialisation failed to avoid a memleak.

Fixes ticket #3858.

Reviewed-by: Nicolas George

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

 ffmpeg_filter.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/ffmpeg_filter.c b/ffmpeg_filter.c
index b6dc42f..7acff28 100644
--- a/ffmpeg_filter.c
+++ b/ffmpeg_filter.c
@@ -898,8 +898,11 @@ int configure_filtergraph(FilterGraph *fg)
         init_input_filter(fg, cur);
 
     for (cur = inputs, i = 0; cur; cur = cur->next, i++)
-        if ((ret = configure_input_filter(fg, fg->inputs[i], cur)) < 0)
+        if ((ret = configure_input_filter(fg, fg->inputs[i], cur)) < 0) {
+            avfilter_inout_free(&inputs);
+            avfilter_inout_free(&outputs);
             return ret;
+        }
     avfilter_inout_free(&inputs);
 
     if (!init || simple) {



More information about the ffmpeg-cvslog mailing list