[0.11] gstreamer: gstvalue: Allow NULL dest when subtracting bitmask

Edward Hervey bilboed at kemper.freedesktop.org
Fri Jan 6 06:02:26 PST 2012


Module: gstreamer
Branch: 0.11
Commit: 77506a82b09cac4303557efc1817917f6e87345d
URL:    http://cgit.freedesktop.org/gstreamer/gstreamer/commit/?id=77506a82b09cac4303557efc1817917f6e87345d

Author: Edward Hervey <edward.hervey at collabora.co.uk>
Date:   Fri Jan  6 15:01:24 2012 +0100

gstvalue: Allow NULL dest when subtracting bitmask

Happens when checking for subsets of caps

---

 gst/gstvalue.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/gst/gstvalue.c b/gst/gstvalue.c
index 0cafa4a..a2aa703 100644
--- a/gst/gstvalue.c
+++ b/gst/gstvalue.c
@@ -4822,7 +4822,6 @@ gst_value_subtract_bitmask_bitmask (GValue * dest,
 {
   guint64 m, s, r;
 
-  g_return_val_if_fail (dest != NULL, FALSE);
   g_return_val_if_fail (GST_VALUE_HOLDS_BITMASK (minuend), FALSE);
   g_return_val_if_fail (GST_VALUE_HOLDS_BITMASK (subtrahend), FALSE);
 
@@ -4830,9 +4829,10 @@ gst_value_subtract_bitmask_bitmask (GValue * dest,
   s = subtrahend->data[0].v_uint64;
   r = m & (~s);
 
-  g_value_init (dest, GST_TYPE_BITMASK);
-  gst_value_set_bitmask (dest, r);
-
+  if (dest) {
+    g_value_init (dest, GST_TYPE_BITMASK);
+    gst_value_set_bitmask (dest, r);
+  }
   return (r != 0);
 }
 



More information about the gstreamer-commits mailing list