History

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.

Stefano Sabatini committed 15 years ago

Commit e8e5dde1 parent e6fb5a41 file · +3 −1Browse files

Unified · Split

libavfilter/graphparser.c+3−1
@@ -393,7 +393,9 @@ int avfilter_graph_parse(AVFilterGraph *graph, const char *filters, · 392 unmodified lines
393393 return 0;
394394
395395 fail:
396− avfilter_graph_free(graph);
396+ for (; graph->filter_count > 0; graph->filter_count--)
397+ avfilter_free(graph->filters[graph->filter_count - 1]);
398+ av_freep(&graph->filters);
397399 free_inout(open_inputs);
398400 free_inout(open_outputs);
399401 free_inout(curr_inputs);

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t