diff --git a/gst/gstparse.c b/gst/gstparse.c index 241453c79b..88ca34bff3 100644 --- a/gst/gstparse.c +++ b/gst/gstparse.c @@ -263,8 +263,10 @@ make_links (graph_t *g, GError **error) b = c->sink_pads; caps = c->caps; - gst_caps_ref (caps); - gst_caps_sink (caps); + if (caps) { + gst_caps_ref (caps); + gst_caps_sink (caps); + } gst_caps_debug (caps, "foo"); /* g_print ("a: %p, b: %p\n", a, b); */ @@ -367,7 +369,9 @@ make_links (graph_t *g, GError **error) } } next: - gst_caps_unref (caps); + if (caps) { + gst_caps_unref (caps); + } l = g_list_next (l); }