Commit 063e7692 authored by Stefano Sabatini's avatar Stefano Sabatini

Make avfilter_formats_unref(AVFilterFormats **ref) handle the case

when *ref is NULL.

Originally committed as revision 21077 to svn://svn.ffmpeg.org/ffmpeg/trunk
parent fe592585
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
#define LIBAVFILTER_VERSION_MAJOR 1 #define LIBAVFILTER_VERSION_MAJOR 1
#define LIBAVFILTER_VERSION_MINOR 14 #define LIBAVFILTER_VERSION_MINOR 14
#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, \
...@@ -231,8 +231,9 @@ AVFilterFormats *avfilter_merge_formats(AVFilterFormats *a, AVFilterFormats *b); ...@@ -231,8 +231,9 @@ AVFilterFormats *avfilter_merge_formats(AVFilterFormats *a, AVFilterFormats *b);
void avfilter_formats_ref(AVFilterFormats *formats, AVFilterFormats **ref); void avfilter_formats_ref(AVFilterFormats *formats, AVFilterFormats **ref);
/** /**
* Removes *ref as a reference to the format list it currently points to, * If *ref is non-NULL, removes *ref as a reference to the format list
* deallocates that list if this was the last reference, and sets *ref to NULL. * it currently points to, deallocates that list if this was the last
* reference, and sets *ref to NULL.
* *
* Before After * Before After
* ________ ________ NULL * ________ ________ NULL
......
...@@ -133,6 +133,9 @@ static int find_ref_index(AVFilterFormats **ref) ...@@ -133,6 +133,9 @@ static int find_ref_index(AVFilterFormats **ref)
void avfilter_formats_unref(AVFilterFormats **ref) void avfilter_formats_unref(AVFilterFormats **ref)
{ {
if (!*ref)
return;
int idx = find_ref_index(ref); int idx = find_ref_index(ref);
if(idx >= 0) if(idx >= 0)
......
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