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 734517 - opusenc: Unref pad template caps after usage
opusenc: Unref pad template caps after usage
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-bad
git master
Other All
: Normal normal
: 1.4.1
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2014-08-09 11:35 UTC by Sebastian Rasmussen
Modified: 2014-08-12 07:53 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Proposed patch. (1.61 KB, patch)
2014-08-09 11:35 UTC, Sebastian Rasmussen
needs-work Details | Review
Proposed patch. (1.65 KB, patch)
2014-08-11 12:19 UTC, Sebastian Rasmussen
committed Details | Review

Description Sebastian Rasmussen 2014-08-09 11:35:03 UTC
This is another instance of gst_pad_get_pad_template_caps() returning a reference but the code does not release the reference. The attached patch aims to fix this.
Comment 1 Sebastian Rasmussen 2014-08-09 11:35:59 UTC
Created attachment 282975 [details] [review]
Proposed patch.
Comment 2 Tim-Philipp Müller 2014-08-10 10:43:54 UTC
Comment on attachment 282975 [details] [review]
Proposed patch.

>-  caps =
>-      gst_caps_copy (gst_pad_get_pad_template_caps (GST_AUDIO_ENCODER_SINK_PAD
>-          (benc)));
>+  caps = gst_pad_get_pad_template_caps (GST_AUDIO_ENCODER_SINK_PAD (benc));
>   if (!allow_multistream) {
>     GValue range = { 0 };
>     g_value_init (&range, GST_TYPE_INT_RANGE);

This is not correct. The code goes on to modify the returned caps in some cases, so they need to be writable.
Comment 3 Sebastian Rasmussen 2014-08-11 12:19:18 UTC
Created attachment 283087 [details] [review]
Proposed patch.

Made caps writable as per review comment. make -C tests/check elements/opus.check still succeeds.
Comment 4 Sebastian Dröge (slomo) 2014-08-11 12:32:58 UTC
commit a9493a39859dcbe437f587fb36c9f8ec1dd0d317
Author: Sebastian Rasmussen <sebras@hotmail.com>
Date:   Fri Aug 8 14:08:19 2014 +0200

    opusenc: Unref pad template caps after usage
    
    Fixes https://bugzilla.gnome.org/show_bug.cgi?id=734517