[gstreamer-bugs] [Bug 640542] New: matroskamux leaks memory after reset

GStreamer (bugzilla.gnome.org) bugzilla at gnome.org
Tue Jan 25 05:53:28 PST 2011


https://bugzilla.gnome.org/show_bug.cgi?id=640542
  GStreamer | gst-plugins-good | 0.10.24

           Summary: matroskamux leaks memory after reset
    Classification: Desktop
           Product: GStreamer
           Version: 0.10.24
        OS/Version: Linux
            Status: UNCONFIRMED
          Severity: normal
          Priority: Normal
         Component: gst-plugins-good
        AssignedTo: gstreamer-bugs at lists.sourceforge.net
        ReportedBy: ognyan.tonchev at axis.com
         QAContact: gstreamer-bugs at lists.sourceforge.net
      GNOME target: ---
     GNOME version: ---


Created an attachment (id=179290)
 View: https://bugzilla.gnome.org/attachment.cgi?id=179290
 Review: https://bugzilla.gnome.org/review?bug=640542&attachment=179290

unit test which triggers the leak

The muxer will leak the ebml_write->caps after reset. I've seen the problem in
plugins-good 0.10.24 but i am pretty sure it also exists in the latest version
of the muxer.

The easiest way to reproduce the leak is:

gst_element_state (pipe, GST_STATE_PLAY);
gst_element_state (pipe, GST_STATE_NULL);
gst_element_state (pipe, GST_STATE_PLAY);

and gst_matroska_mux_start () will create new caps without unreffing the old
caps. The suggested fix is to unref the caps in gst_ebml_write_reset ():

void
gst_ebml_write_reset (GstEbmlWrite * ebml)
{
  ebml->pos = 0;

  if (ebml->cache) {
    gst_byte_writer_free (ebml->cache);
    ebml->cache = NULL;
  }

  if (ebml->caps) {
    gst_caps_unref (ebml->caps);
    ebml->caps = NULL;
  }

  ebml->last_write_result = GST_FLOW_OK;
  ebml->timestamp = GST_CLOCK_TIME_NONE;
  ebml->need_newsegment = TRUE;
}

Attached is also a unit test which triggers the problem.

-- 
Configure bugmail: https://bugzilla.gnome.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.




More information about the Gstreamer-bugs mailing list