After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 636827 - Usage of gst_caps_interset where gst_caps_can_intersect was intended?
Usage of gst_caps_interset where gst_caps_can_intersect was intended?
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-base
unspecified
Other All
: Normal normal
: 0.10.32
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2010-12-08 23:00 UTC by Gavin Stark
Modified: 2010-12-09 07:41 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Gavin Stark 2010-12-08 23:00:12 UTC
In commit f5469d42deb05fcc32f1226ff6c25d9dd978dc43 gst_caps_intersect was changed to gst_caps_can_intersect however on line 2090, gst_caps_intersect was used:


-  intersection = gst_caps_intersect (xvimagesink->xcontext->caps, caps);
-  GST_DEBUG_OBJECT (xvimagesink, "intersection returned %" GST_PTR_FORMAT,
-      intersection);
-  if (gst_caps_is_empty (intersection))
+  if (!gst_caps_intersect (xvimagesink->xcontext->caps, caps))
     goto incompatible_caps;
 
-  gst_caps_unref (intersection);
-

I believe this is leading to a leak of the resulting caps when there is an intersection.  I can supply some valgrind results if necessary.
Comment 1 Sebastian Dröge (slomo) 2010-12-09 07:41:13 UTC
Yes, you're right. Thanks for spotting


commit b00f8a5b363a8f2b5eeb0431c25d5d2b00b0af49
Author: Gavin Stark <g.stark@realdigitalmedia.com>
Date:   Thu Dec 9 08:40:25 2010 +0100

    xvimagesink: Use gst_caps_can_intersect() instead of gst_caps_intersect()
    
    Fixes a memory leak and bug #636827.