[SCM] libav/experimental: Make avfilter_formats_unref(AVFilterFormats **ref) handle the case when *ref is NULL.
siretart at users.alioth.debian.org
siretart at users.alioth.debian.org
Sun Jun 30 16:57:02 UTC 2013
The following commit has been merged in the experimental branch:
commit 063e7692731798426ef90989211ed7d07f9dc38f
Author: Stefano Sabatini <stefano.sabatini-lala at poste.it>
Date: Thu Jan 7 22:59:22 2010 +0000
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
diff --git a/libavfilter/avfilter.h b/libavfilter/avfilter.h
index a796280..ddf13c3 100644
--- a/libavfilter/avfilter.h
+++ b/libavfilter/avfilter.h
@@ -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(AVFilterFormats *a, AVFilterFormats *b);
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
diff --git a/libavfilter/formats.c b/libavfilter/formats.c
index e558195..e175cd3 100644
--- a/libavfilter/formats.c
+++ b/libavfilter/formats.c
@@ -133,6 +133,9 @@ static int find_ref_index(AVFilterFormats **ref)
void avfilter_formats_unref(AVFilterFormats **ref)
{
+ if (!*ref)
+ return;
+
int idx = find_ref_index(ref);
if(idx >= 0)
--
Libav/FFmpeg packaging
More information about the pkg-multimedia-commits
mailing list