Revision 4359288c libavfilter/avfiltergraph.c

View differences:

libavfilter/avfiltergraph.c
32 32
    return av_mallocz(sizeof(AVFilterGraph));
33 33
}
34 34

  
35
void avfilter_graph_free(AVFilterGraph *graph)
35
void avfilter_graph_free(AVFilterGraph **graph)
36 36
{
37
    if (!graph)
37
    if (!*graph)
38 38
        return;
39
    for (; graph->filter_count > 0; graph->filter_count --)
40
        avfilter_free(graph->filters[graph->filter_count - 1]);
41
    av_freep(&graph->scale_sws_opts);
42
    av_freep(&graph->filters);
39
    for (; (*graph)->filter_count > 0; (*graph)->filter_count--)
40
        avfilter_free((*graph)->filters[(*graph)->filter_count - 1]);
41
    av_freep(&(*graph)->scale_sws_opts);
42
    av_freep(&(*graph)->filters);
43
    av_freep(graph);
43 44
}
44 45

  
45 46
int avfilter_graph_add_filter(AVFilterGraph *graph, AVFilterContext *filter)

Also available in: Unified diff