xvidenc: Always return reffed caps from _getcaps
authorSjoerd Simons <sjoerd.simons@collabora.co.uk>
Tue, 3 May 2011 14:47:02 +0000 (15:47 +0100)
committerSjoerd Simons <sjoerd.simons@collabora.co.uk>
Tue, 3 May 2011 14:47:05 +0000 (15:47 +0100)
Not returning ref caps will leads to crashes and refcounting issues in
upstream elements

ext/xvid/gstxvidenc.c

index cdd45cd..6b20080 100644 (file)
@@ -806,7 +806,7 @@ gst_xvidenc_getcaps (GstPad * pad)
 
   /* If we already have caps return them */
   if (GST_PAD_CAPS (pad))
-    return GST_PAD_CAPS (pad);
+    return gst_caps_ref (GST_PAD_CAPS (pad));
 
   xvidenc = GST_XVIDENC (gst_pad_get_parent (pad));
   if (!xvidenc)