* commit '1565cbc65cbb9f95c11367314a080068895e0cf0': lavfi: make avfilter_free() remove the filter from its graph. Conflicts: libavfilter/avfilter.c libavfilter/avfiltergraph.c libavfilter/graphparser.c
Showing the changes to libavfilter/graphparser.c (1 of 5 files). Show all
Unified · Split
| @@ -430,8 +430,8 @@ int avfilter_graph_parse2(AVFilterGraph *graph, const char *filters, · 429 unmodified lines | ||
| 430 | 430 | return 0; |
| 431 | 431 | |
| 432 | 432 | fail:end: |
| 433 | − for (; graph->nb_filters > 0; graph->nb_filters--) | |
| 434 | − avfilter_free(graph->filters[graph->nb_filters - 1]); | |
| 433 | + while (graph->nb_filters) | |
| 434 | + avfilter_free(graph->filters[0]); | |
| 435 | 435 | av_freep(&graph->filters); |
| 436 | 436 | avfilter_inout_free(&open_inputs); |
| 437 | 437 | avfilter_inout_free(&open_outputs); |
| @@ -498,8 +498,8 @@ int avfilter_graph_parse(AVFilterGraph *graph, const char *filters, · 60 unmodified lines | ||
| 498 | 498 | |
| 499 | 499 | fail: |
| 500 | 500 | if (ret < 0) { |
| 501 | − for (; graph->nb_filters > 0; graph->nb_filters--) | |
| 502 | − avfilter_free(graph->filters[graph->nb_filters - 1]); | |
| 501 | + while (graph->nb_filters) | |
| 502 | + avfilter_free(graph->filters[0]); | |
| 503 | 503 | av_freep(&graph->filters); |
| 504 | 504 | } |
| 505 | 505 | avfilter_inout_free(&inputs); |