Browse code

Make avfilter_unref_buffer() accept a NULL parameter.

Originally committed as revision 26373 to svn://svn.ffmpeg.org/ffmpeg/trunk

Stefano Sabatini authored on 2011/01/16 02:21:15
Showing 2 changed files
... ...
@@ -70,6 +70,8 @@ AVFilterBufferRef *avfilter_ref_buffer(AVFilterBufferRef *ref, int pmask)
70 70
 
71 71
 void avfilter_unref_buffer(AVFilterBufferRef *ref)
72 72
 {
73
+    if (!ref)
74
+        return;
73 75
     if (!(--ref->buf->refcount))
74 76
         ref->buf->free(ref->buf);
75 77
     av_free(ref->video);
... ...
@@ -28,7 +28,7 @@
28 28
 
29 29
 #define LIBAVFILTER_VERSION_MAJOR  1
30 30
 #define LIBAVFILTER_VERSION_MINOR 73
31
-#define LIBAVFILTER_VERSION_MICRO  1
31
+#define LIBAVFILTER_VERSION_MICRO  2
32 32
 
33 33
 #define LIBAVFILTER_VERSION_INT AV_VERSION_INT(LIBAVFILTER_VERSION_MAJOR, \
34 34
                                                LIBAVFILTER_VERSION_MINOR, \
... ...
@@ -177,7 +177,7 @@ AVFilterBufferRef *avfilter_ref_buffer(AVFilterBufferRef *ref, int pmask);
177 177
  * Remove a reference to a buffer. If this is the last reference to the
178 178
  * buffer, the buffer itself is also automatically freed.
179 179
  *
180
- * @param ref reference to the buffer
180
+ * @param ref reference to the buffer, may be NULL
181 181
  */
182 182
 void avfilter_unref_buffer(AVFilterBufferRef *ref);
183 183