[FFmpeg-cvslog] r21077 - in trunk/libavfilter: avfilter.h formats.c

stefano subversion
Thu Jan 7 23:59:23 CET 2010


Author: stefano
Date: Thu Jan  7 23:59:22 2010
New Revision: 21077

Log:
Make avfilter_formats_unref(AVFilterFormats **ref) handle the case
when *ref is NULL.

Modified:
   trunk/libavfilter/avfilter.h
   trunk/libavfilter/formats.c

Modified: trunk/libavfilter/avfilter.h
==============================================================================
--- trunk/libavfilter/avfilter.h	Thu Jan  7 23:52:46 2010	(r21076)
+++ trunk/libavfilter/avfilter.h	Thu Jan  7 23:59:22 2010	(r21077)
@@ -26,7 +26,7 @@
 
 #define LIBAVFILTER_VERSION_MAJOR  1
 #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, \
                                                LIBAVFILTER_VERSION_MINOR, \
@@ -231,8 +231,9 @@ AVFilterFormats *avfilter_merge_formats(
 void avfilter_formats_ref(AVFilterFormats *formats, AVFilterFormats **ref);
 
 /**
- * Removes *ref as a reference to the format list it currently points to,
- * deallocates that list if this was the last reference, and sets *ref to NULL.
+ * If *ref is non-NULL, removes *ref as a reference to the format list
+ * it currently points to, deallocates that list if this was the last
+ * reference, and sets *ref to NULL.
  *
  *         Before                                 After
  *   ________                               ________         NULL

Modified: trunk/libavfilter/formats.c
==============================================================================
--- trunk/libavfilter/formats.c	Thu Jan  7 23:52:46 2010	(r21076)
+++ trunk/libavfilter/formats.c	Thu Jan  7 23:59:22 2010	(r21077)
@@ -133,6 +133,9 @@ static int find_ref_index(AVFilterFormat
 
 void avfilter_formats_unref(AVFilterFormats **ref)
 {
+    if (!*ref)
+        return;
+
     int idx = find_ref_index(ref);
 
     if(idx >= 0)



More information about the ffmpeg-cvslog mailing list