GNOME Bugzilla – Bug 734517
opusenc: Unref pad template caps after usage
Last modified: 2014-08-12 07:53:16 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.
Created attachment 282975 [details] [review] Proposed patch.
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.
Created attachment 283087 [details] [review] Proposed patch. Made caps writable as per review comment. make -C tests/check elements/opus.check still succeeds.
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