ffmpeg: Clean up if filter initialisation failed to avoid a memleak.
authorCarl Eugen Hoyos <cehoyos@ag.or.at>
Sat, 30 Aug 2014 10:27:50 +0000 (12:27 +0200)
committerCarl Eugen Hoyos <cehoyos@ag.or.at>
Sat, 30 Aug 2014 11:01:51 +0000 (13:01 +0200)
Fixes ticket #3858.

Reviewed-by: Nicolas George
ffmpeg_filter.c

index b6dc42f..7acff28 100644 (file)
@@ -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) {