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 693324 - gdppay: leak when getting caps identical to your current ones
gdppay: leak when getting caps identical to your current ones
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-bad
git master
Other Linux
: Normal normal
: 1.0.6
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2013-02-07 13:12 UTC by Tim 'mithro' Ansell
Modified: 2013-02-07 14:11 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch which fixes the leak. (1.05 KB, patch)
2013-02-07 13:12 UTC, Tim 'mithro' Ansell
committed Details | Review

Description Tim 'mithro' Ansell 2013-02-07 13:12:29 UTC
Created attachment 235397 [details] [review]
Patch which fixes the leak.

This code leaks when the incoming caps are equal to this->caps;

    case GST_EVENT_CAPS:{
      gst_event_parse_caps (event, &caps);
      if (this->caps == NULL || !gst_caps_is_equal (this->caps, caps)) {
        GST_INFO_OBJECT (pad, "caps changed to %" GST_PTR_FORMAT, caps);
        gst_buffer_replace (&outbuffer, NULL);
        gst_caps_replace (&this->caps, caps);
        outbuffer = gst_gdp_buffer_from_caps (this, caps);
        if (outbuffer == NULL)
          goto no_buffer_from_caps;

        GST_BUFFER_DURATION (outbuffer) = 0;
        GST_BUFFER_FLAG_SET (outbuffer, GST_BUFFER_FLAG_HEADER);
        if (this->caps_buf)
          gst_buffer_unref (this->caps_buf);
        this->caps_buf = outbuffer;
        gst_gdp_pay_reset_streamheader (this);
      }
      break;
    }
Comment 1 Tim-Philipp Müller 2013-02-07 14:09:00 UTC
Thanks!

commit c8cbe98d906664c488ef5ab43ae6d6aea46db94b
Author: Tim 'mithro' Ansell <mithro@mithis.com>
Date:   Fri Feb 8 00:06:16 2013 +1100

    gdppay: fix buffer leak when new caps are same as old caps
    
    The leak occurs when you got a message with identical caps to the ones you
    already had.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=693324