aboutsummaryrefslogtreecommitdiffstats
path: root/libavfilter/graphparser.c
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2013-03-31 13:02:55 +0200
committerAnton Khirnov <anton@khirnov.net>2013-04-11 20:38:48 +0200
commit1565cbc65cbb9f95c11367314a080068895e0cf0 (patch)
treeb97be56bae403beb5e75d2328833dca9af148792 /libavfilter/graphparser.c
parent111367263af41c88a44bd763ceefc11d53a7f655 (diff)
downloadffmpeg-1565cbc65cbb9f95c11367314a080068895e0cf0.tar.gz
lavfi: make avfilter_free() remove the filter from its graph.
Diffstat (limited to 'libavfilter/graphparser.c')
-rw-r--r--libavfilter/graphparser.c8
1 files changed, 4 insertions, 4 deletions
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);