From 5bf13cdd5314bc3c6c81bd620e712acdcab14eb2 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sebastian=20Dr=C3=B6ge?= Date: Tue, 13 Aug 2019 19:57:08 +0300 Subject: [PATCH] aggregator: Assert if the sink/src pad type that is to be used is not a GstAggregatorPad or subclass thereof --- libs/gst/base/gstaggregator.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libs/gst/base/gstaggregator.c b/libs/gst/base/gstaggregator.c index 15672cf..94d4816 100644 --- a/libs/gst/base/gstaggregator.c +++ b/libs/gst/base/gstaggregator.c @@ -1688,6 +1688,7 @@ gst_aggregator_default_create_new_pad (GstAggregator * self, } name = g_strdup_printf ("sink_%u", serial); + g_assert (g_type_is_a (pad_type, GST_TYPE_AGGREGATOR_PAD)); agg_pad = g_object_new (pad_type, "name", name, "direction", GST_PAD_SINK, "template", templ, NULL); g_free (name); @@ -2454,6 +2455,7 @@ gst_aggregator_init (GstAggregator * self, GstAggregatorClass * klass) GST_PAD_TEMPLATE_GTYPE (pad_template) == G_TYPE_NONE ? GST_TYPE_AGGREGATOR_PAD : GST_PAD_TEMPLATE_GTYPE (pad_template); + g_assert (g_type_is_a (pad_type, GST_TYPE_AGGREGATOR_PAD)); self->srcpad = g_object_new (pad_type, "name", "src", "direction", GST_PAD_SRC, "template", pad_template, NULL); -- 2.7.4