caps: unset the parent refcount of the old features before freeing them in gst_caps_s...
authorGeorge Kiagiadakis <george.kiagiadakis@collabora.com>
Thu, 26 Jun 2014 08:16:34 +0000 (11:16 +0300)
committerGeorge Kiagiadakis <george.kiagiadakis@collabora.com>
Thu, 26 Jun 2014 08:16:34 +0000 (11:16 +0300)
Otherwise gst_caps_features_free() asserts and the features structure is leaked

gst/gstcaps.c

index 4525ead1fc708c7f4d8df4c55a4768832dd7a71d..51f7ae4e04ff2e939f37aaebe9b663fa6d7aa8e2 100644 (file)
@@ -901,8 +901,10 @@ gst_caps_set_features (GstCaps * caps, guint index, GstCapsFeatures * features)
   if (features)
     gst_caps_features_set_parent_refcount (features, &GST_CAPS_REFCOUNT (caps));
 
-  if (old)
+  if (old) {
+    gst_caps_features_set_parent_refcount (old, NULL);
     gst_caps_features_free (old);
+  }
 }
 
 /**