summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gst/playback/gstplaybackutils.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/gst/playback/gstplaybackutils.c b/gst/playback/gstplaybackutils.c
index ef98528e0..00becf0ed 100644
--- a/gst/playback/gstplaybackutils.c
+++ b/gst/playback/gstplaybackutils.c
@@ -82,6 +82,10 @@ gst_playback_utils_get_n_common_capsfeatures (GstElementFactory * fact1,
fact2_tmpl_caps = get_template_caps (fact2, GST_PAD_SINK);
if (!fact1_tmpl_caps || !fact2_tmpl_caps) {
GST_ERROR ("Failed to get template caps from decoder or sink");
+ if (fact1_tmpl_caps)
+ gst_caps_unref (fact1_tmpl_caps);
+ else if (fact2_tmpl_caps)
+ gst_caps_unref (fact2_tmpl_caps);
return 0;
}