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 513964 - [GstPad] gst_pad_get_caps don't return a copy of the caps
[GstPad] gst_pad_get_caps don't return a copy of the caps
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gstreamer (core)
git master
Other Linux
: Normal normal
: 0.10.18
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2008-02-02 21:37 UTC by Thijs Vermeir
Modified: 2008-02-07 20:46 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
add gst_caps_make_writable (585 bytes, patch)
2008-02-02 21:39 UTC, Thijs Vermeir
committed Details | Review

Description Thijs Vermeir 2008-02-02 21:37:01 UTC
the function gst_pad_get_caps promises in the documentation:
"Returns : a newly allocated copy of the GstCaps of this pad. MT safe."

However in the case that there is are no caps on this pad, we get the caps from the template. This caps are not copied but only reffed. (gstpad.c:2011)
Comment 1 Thijs Vermeir 2008-02-02 21:39:38 UTC
Created attachment 104279 [details] [review]
add gst_caps_make_writable

Be sure that we have copies of the caps
Comment 2 Thijs Vermeir 2008-02-04 14:17:33 UTC
Log message:
       * gst/gstpad.c:
       * tests/check/gst/gstpad.c:
       Be sure that we have a new copy of the caps and not
       reffed caps from a template
Comment 3 Wim Taymans 2008-02-04 14:22:34 UTC
I was thinking of changing the docs instead. Making a copy instead of _ref() introduces unneeded overhead.