summaryrefslogtreecommitdiff
path: root/gst
diff options
context:
space:
mode:
authorAshish Kumar <kr.ashish@samsung.com>2017-10-31 15:04:47 +0530
committerTim-Philipp Müller <tim@centricular.com>2018-01-17 12:18:41 +0000
commitb927d60371a14c968c9a8d19c577646427534074 (patch)
tree24e02f091606727bccab1826623bb518f6ae4d82 /gst
parente7f77f3a01c874bf6293b8a932dab4f59cf8a191 (diff)
playback-utils: Fix caps leak on failure
https://bugzilla.gnome.org/show_bug.cgi?id=789358
Diffstat (limited to 'gst')
-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;
}