Commit caeb0c30 authored by Stefano Sabatini's avatar Stefano Sabatini
Browse files

Make avfilter_graph_free() do nothing if graph is NULL.

Originally committed as revision 26323 to svn://svn.ffmpeg.org/ffmpeg/trunk
parent b382d1e3
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
#define LIBAVFILTER_VERSION_MAJOR 1 #define LIBAVFILTER_VERSION_MAJOR 1
#define LIBAVFILTER_VERSION_MINOR 73 #define LIBAVFILTER_VERSION_MINOR 73
#define LIBAVFILTER_VERSION_MICRO 0 #define LIBAVFILTER_VERSION_MICRO 1
#define LIBAVFILTER_VERSION_INT AV_VERSION_INT(LIBAVFILTER_VERSION_MAJOR, \ #define LIBAVFILTER_VERSION_INT AV_VERSION_INT(LIBAVFILTER_VERSION_MAJOR, \
LIBAVFILTER_VERSION_MINOR, \ LIBAVFILTER_VERSION_MINOR, \
......
...@@ -34,6 +34,8 @@ AVFilterGraph *avfilter_graph_alloc(void) ...@@ -34,6 +34,8 @@ AVFilterGraph *avfilter_graph_alloc(void)
void avfilter_graph_free(AVFilterGraph *graph) void avfilter_graph_free(AVFilterGraph *graph)
{ {
if (!graph)
return;
for (; graph->filter_count > 0; graph->filter_count --) for (; graph->filter_count > 0; graph->filter_count --)
avfilter_free(graph->filters[graph->filter_count - 1]); avfilter_free(graph->filters[graph->filter_count - 1]);
av_freep(&graph->scale_sws_opts); av_freep(&graph->scale_sws_opts);
......
...@@ -79,7 +79,7 @@ int avfilter_graph_create_filter(AVFilterContext **filt_ctx, AVFilter *filt, ...@@ -79,7 +79,7 @@ int avfilter_graph_create_filter(AVFilterContext **filt_ctx, AVFilter *filt,
int avfilter_graph_config(AVFilterGraph *graphctx, AVClass *log_ctx); int avfilter_graph_config(AVFilterGraph *graphctx, AVClass *log_ctx);
/** /**
* Free a graph and destroy its links. * Free a graph and destroy its links, graph may be NULL.
*/ */
void avfilter_graph_free(AVFilterGraph *graph); void avfilter_graph_free(AVFilterGraph *graph);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment