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 693307 - videomixer2 leaks caps reference
videomixer2 leaks caps reference
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-good
git master
Other Linux
: Normal normal
: 1.0.6
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2013-02-07 10:26 UTC by Tim 'mithro' Ansell
Modified: 2013-02-07 10:41 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Memory leak fix. (596 bytes, patch)
2013-02-07 10:26 UTC, Tim 'mithro' Ansell
none Details | Review

Description Tim 'mithro' Ansell 2013-02-07 10:26:07 UTC
Created attachment 235373 [details] [review]
Memory leak fix.

static gboolean
gst_videomixer2_query_caps (GstPad * pad, GstObject * parent, GstQuery * query)
{
  GstCaps *filter, *caps;
  GstVideoMixer2 *mix = GST_VIDEO_MIXER2 (parent);
  GstStructure *s;
  gint n;

  gst_query_parse_caps (query, &filter);

  if (GST_VIDEO_INFO_FORMAT (&mix->info) != GST_VIDEO_FORMAT_UNKNOWN) {
    caps = gst_pad_get_current_caps (mix->srcpad);
  } else {
    caps = gst_pad_get_pad_template_caps (mix->srcpad);
  }

  caps = gst_caps_make_writable (caps);

  n = gst_caps_get_size (caps) - 1;
  for (; n >= 0; n--) {
    s = gst_caps_get_structure (caps, n);
    gst_structure_set (s, "width", GST_TYPE_INT_RANGE, 1, G_MAXINT,
        "height", GST_TYPE_INT_RANGE, 1, G_MAXINT, NULL);
    if (GST_VIDEO_INFO_FPS_D (&mix->info) != 0) {
      gst_structure_set (s,
          "framerate", GST_TYPE_FRACTION_RANGE, 0, 1, G_MAXINT, 1, NULL);
    }
  }
  gst_query_set_caps_result (query, caps);
  return TRUE;
}
Comment 1 Wim Taymans 2013-02-07 10:41:46 UTC
commit 3a5d17e852ae2d1b227d9c54a96494327a8b9976
Author: Tim 'mithro' Ansell <gnome at mithis.com>
Date:   Thu Feb 7 11:40:35 2013 +0100

    videomixer2: avoid caps leak
    
    Fixes https://bugzilla.gnome.org/show_bug.cgi?id=693307