diff options
author | Vineeth T M <vineeth.tm@samsung.com> | 2014-09-01 16:39:23 +0530 |
---|---|---|
committer | Sebastian Dröge <sebastian@centricular.com> | 2014-09-01 14:34:43 +0300 |
commit | 3a1e01022151c3262140d5d864a71a1bab2938c7 (patch) | |
tree | 6afcaef977a82c0b247c1ac05b27260c020810de | |
parent | 116649371ec83a0feaba525949800253139e3ffb (diff) |
imagefreeze: Don't call gst_caps_unref() on template caps when already unreferenced
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
-rw-r--r-- | gst/imagefreeze/gstimagefreeze.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/gst/imagefreeze/gstimagefreeze.c b/gst/imagefreeze/gstimagefreeze.c index 9395db9be..1a0c73a3f 100644 --- a/gst/imagefreeze/gstimagefreeze.c +++ b/gst/imagefreeze/gstimagefreeze.c @@ -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); |