X-Git-Url: http://git.videolan.org/?p=ffmpeg.git;a=blobdiff_plain;f=libavfilter%2Favfiltergraph.c;h=4e5bfd2f1014cc11ad0e611e585340ec2033a44d;hp=7b9d96379a2572f053f86f66a68bb118d1d2af2e;hb=ffcaef348580ba32c57a85e115c0809e5b857d95;hpb=eccb6fb7ceee92a8f7456005246c38c66aac8550 diff --git a/libavfilter/avfiltergraph.c b/libavfilter/avfiltergraph.c index 7b9d96379a..4e5bfd2f10 100644 --- a/libavfilter/avfiltergraph.c +++ b/libavfilter/avfiltergraph.c @@ -32,13 +32,18 @@ AVFilterGraph *avfilter_create_graph(void) return av_mallocz(sizeof(AVFilterGraph)); } -void avfilter_destroy_graph(AVFilterGraph *graph) +static void destroy_graph_filters(AVFilterGraph *graph) { unsigned i; for(i = 0; i < graph->filter_count; i ++) avfilter_destroy(graph->filters[i]); - av_free(graph->filters); + av_freep(&graph->filters); +} + +void avfilter_destroy_graph(AVFilterGraph *graph) +{ + destroy_graph_filters(graph); av_free(graph); }