elementfactory: don't crash if no element klass has been set
authorAndreas Frisch <fraxinas@opendreambox.org>
Wed, 12 Sep 2012 12:14:31 +0000 (14:14 +0200)
committerTim-Philipp Müller <tim@centricular.net>
Wed, 12 Sep 2012 21:53:41 +0000 (22:53 +0100)
https://bugzilla.gnome.org/show_bug.cgi?id=683865

gst/gstelementfactory.c

index f3e1bdb..c97e8c9 100644 (file)
@@ -686,6 +686,11 @@ gst_element_factory_list_is_type (GstElementFactory * factory,
   klass =
       gst_element_factory_get_metadata (factory, GST_ELEMENT_METADATA_KLASS);
 
+  if (klass == NULL) {
+    GST_ERROR_OBJECT (factory, "element factory is missing klass identifiers");
+    return res;
+  }
+
   /* Filter by element type first, as soon as it matches
    * one type, we skip all other tests */
   if (!res && (type & GST_ELEMENT_FACTORY_TYPE_SINK))