diff --git a/libavfilter/graphparser.c b/libavfilter/graphparser.c index 7151e4febc03472dfcd591c059d61374ee1bba46..47179e5e542116331c639fce38f279d3de0134ad 100644 --- a/libavfilter/graphparser.c +++ b/libavfilter/graphparser.c @@ -393,7 +393,9 @@ int avfilter_graph_parse(AVFilterGraph *graph, const char *filters, return 0; fail: - avfilter_graph_free(graph); + for (; graph->filter_count > 0; graph->filter_count--) + avfilter_free(graph->filters[graph->filter_count - 1]); + av_freep(&graph->filters); free_inout(open_inputs); free_inout(open_outputs); free_inout(curr_inputs);