imagefreeze: Don't call gst_caps_unref() on template caps when already unreferenced
authorVineeth T M <vineeth.tm@samsung.com>
Mon, 1 Sep 2014 11:09:23 +0000 (16:39 +0530)
committerSebastian Dröge <sebastian@centricular.com>
Mon, 1 Sep 2014 11:34:43 +0000 (14:34 +0300)
Adding an extra condition while calling gst_caps_unref (templ)
and replacing gst_caps_make_writable (gst_caps_ref (caps)) with
gst_caps_copy (caps) in line 177, since the functionality is same.

https://bugzilla.gnome.org/show_bug.cgi?id=735795

gst/imagefreeze/gstimagefreeze.c

index 9395db9..1a0c73a 100644 (file)
@@ -174,7 +174,7 @@ gst_image_freeze_sink_setcaps (GstImageFreeze * self, GstCaps * caps)
   GstPad *pad;
 
   pad = self->sinkpad;
-  caps = gst_caps_make_writable (gst_caps_ref (caps));
+  caps = gst_caps_copy (caps);
 
   GST_DEBUG_OBJECT (pad, "Setting caps: %" GST_PTR_FORMAT, caps);
 
@@ -285,7 +285,8 @@ gst_image_freeze_sink_getcaps (GstImageFreeze * self, GstCaps * filter)
     GST_LOG_OBJECT (self, "going to copy");
     ret = gst_caps_copy (templ);
   }
-  gst_caps_unref (templ);
+  if (templ)
+    gst_caps_unref (templ);
   if (filter)
     gst_caps_unref (filter);