theoraenc: fix caps leak
authorVincent Penquerc'h <vincent.penquerch@collabora.co.uk>
Thu, 25 Aug 2011 13:55:14 +0000 (14:55 +0100)
committerTim-Philipp Müller <tim.muller@collabora.co.uk>
Thu, 25 Aug 2011 14:17:01 +0000 (15:17 +0100)
https://bugzilla.gnome.org/show_bug.cgi?id=657333

ext/theora/gsttheoraenc.c

index acc5bd6..5caf262 100644 (file)
@@ -627,7 +627,7 @@ theora_enc_sink_getcaps (GstPad * pad)
   peer = gst_pad_get_peer (encoder->srcpad);
   if (peer) {
     const GstCaps *templ_caps;
-    GstCaps *peer_caps;
+    GstCaps *peer_caps, *tmp_caps;
     GstStructure *s;
     guint i, n;
 
@@ -645,8 +645,9 @@ theora_enc_sink_getcaps (GstPad * pad)
 
     templ_caps = gst_pad_get_pad_template_caps (pad);
 
-    caps = gst_caps_intersect (peer_caps, templ_caps);
-    caps = gst_caps_intersect (caps, theora_enc_src_caps);
+    tmp_caps = gst_caps_intersect (peer_caps, templ_caps);
+    caps = gst_caps_intersect (tmp_caps, theora_enc_src_caps);
+    gst_caps_unref (tmp_caps);
     gst_caps_unref (peer_caps);
     gst_object_unref (peer);
     peer = NULL;