From 1565cbc65cbb9f95c11367314a080068895e0cf0 Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Sun, 31 Mar 2013 13:02:55 +0200 Subject: lavfi: make avfilter_free() remove the filter from its graph. --- libavfilter/graphparser.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'libavfilter/graphparser.c') diff --git a/libavfilter/graphparser.c b/libavfilter/graphparser.c index 7fbe43b3d0..5738a12e06 100644 --- a/libavfilter/graphparser.c +++ b/libavfilter/graphparser.c @@ -430,8 +430,8 @@ int avfilter_graph_parse2(AVFilterGraph *graph, const char *filters, return 0; fail: - for (; graph->nb_filters > 0; graph->nb_filters--) - avfilter_free(graph->filters[graph->nb_filters - 1]); + while (graph->nb_filters) + avfilter_free(graph->filters[0]); av_freep(&graph->filters); avfilter_inout_free(&open_inputs); avfilter_inout_free(&open_outputs); @@ -495,8 +495,8 @@ int avfilter_graph_parse(AVFilterGraph *graph, const char *filters, fail: if (ret < 0) { - for (; graph->nb_filters > 0; graph->nb_filters--) - avfilter_free(graph->filters[graph->nb_filters - 1]); + while (graph->nb_filters) + avfilter_free(graph->filters[0]); av_freep(&graph->filters); } avfilter_inout_free(&inputs); -- cgit v1.2.3