Browse code

Make avfilter_graph_parse() not free the input graph

Make avfilter_graph_parse() only release the internal structures
allocated during the parsing, and leave to free the graph itself to
the calling code.

This approach looks cleaner, as the graph is not allocated by the
function.

Signed-off-by: Mans Rullgard <mans@mansr.com>

Stefano Sabatini authored on 2011/02/02 05:52:07
Showing 1 changed files
... ...
@@ -393,7 +393,9 @@ int avfilter_graph_parse(AVFilterGraph *graph, const char *filters,
393 393
     return 0;
394 394
 
395 395
  fail:
396
-    avfilter_graph_free(graph);
396
+    for (; graph->filter_count > 0; graph->filter_count--)
397
+        avfilter_free(graph->filters[graph->filter_count - 1]);
398
+    av_freep(&graph->filters);
397 399
     free_inout(open_inputs);
398 400
     free_inout(open_outputs);
399 401
     free_inout(curr_inputs);