ghostpad: ensure we build a ghost pad ..
authorMathieu Duponchelle <mathieu@centricular.com>
Thu, 1 Mar 2018 00:12:07 +0000 (01:12 +0100)
committerMathieu Duponchelle <mathieu@centricular.com>
Thu, 1 Mar 2018 00:12:07 +0000 (01:12 +0100)
When we construct from a custom GType

gst/gstghostpad.c

index dd53122..90cae38 100644 (file)
@@ -635,6 +635,8 @@ gst_ghost_pad_new_full (const gchar * name, GstPadDirection dir,
         GST_PAD_TEMPLATE_GTYPE (templ) ==
         G_TYPE_NONE ? GST_TYPE_GHOST_PAD : GST_PAD_TEMPLATE_GTYPE (templ);
 
+    g_return_val_if_fail (g_type_is_a (pad_type, GST_TYPE_GHOST_PAD), NULL);
+
     ret = g_object_new (pad_type, "name", name,
         "direction", dir, "template", templ, NULL);
   } else {