[Bug 667419] matroskamux memleaks

GStreamer (bugzilla.gnome.org) bugzilla at gnome.org
Tue Jan 10 07:11:30 PST 2012


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

--- Comment #12 from Nicola <lists at svrinformatica.it> 2012-01-10 15:11:24 UTC ---
Created an attachment (id=204947)
 View: https://bugzilla.gnome.org/attachment.cgi?id=204947
 Review: https://bugzilla.gnome.org/review?bug=667419&attachment=204947

removed duplicate free

please note that the original code was:

   if (context->codec_priv != NULL) {
      g_free (context->codec_priv);
      context->codec_priv = NULL;
      context->codec_priv_size = 0;
    }

    /* Create avcC header */
    if (codec_buf != NULL) {
      context->codec_priv_size = GST_BUFFER_SIZE (codec_buf);
      context->codec_priv = g_malloc0 (context->codec_priv_size);
      memcpy (context->codec_priv, GST_BUFFER_DATA (codec_buf),
          context->codec_priv_size);
    }

so the free was ever done and codec_priv was assigned only if codec_buf != NULL

in this patch the free is done only before codec_priv assignment

maybe could be some other side effect if codec_buf == NULL, in the original
matroskamux codec_priv was null in this case, with the attached patch the
previous value is not modified

-- 
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