diff options
author | Stefano Sabatini <stefano.sabatini-lala@poste.it> | 2011-02-01 21:52:07 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2011-02-06 20:31:42 +0100 |
commit | c68be8e135ddcd8a043142d26a5fdc4ef01b1218 (patch) | |
tree | c66460ff5d3581037230934b50301fc745294a86 /libavfilter | |
parent | 2d9fd1810bdf7ce9135aa39145b85a35a0ba3dac (diff) | |
download | ffmpeg-c68be8e135ddcd8a043142d26a5fdc4ef01b1218.tar.gz |
Make avfilter_graph_parse() not free the input graph
Make avfilter_graph_parse() only release the internal structures
allocated during the parsing, and leave to free the graph itself to
the calling code.
This approach looks cleaner, as the graph is not allocated by the
function.
Signed-off-by: Mans Rullgard <mans@mansr.com>
(cherry picked from commit e8e5dde779fca80d86e00baea26d1baca333f4c0)
Diffstat (limited to 'libavfilter')
-rw-r--r-- | libavfilter/graphparser.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/libavfilter/graphparser.c b/libavfilter/graphparser.c index 7151e4febc..47179e5e54 100644 --- a/libavfilter/graphparser.c +++ b/libavfilter/graphparser.c @@ -393,7 +393,9 @@ int avfilter_graph_parse(AVFilterGraph *graph, const char *filters, return 0; fail: - avfilter_graph_free(graph); + for (; graph->filter_count > 0; graph->filter_count--) + avfilter_free(graph->filters[graph->filter_count - 1]); + av_freep(&graph->filters); free_inout(open_inputs); free_inout(open_outputs); free_inout(curr_inputs); |