element-monitor: protect agains elements that have no klass
authorEdward Hervey <edward@collabora.com>
Mon, 2 Sep 2013 15:11:25 +0000 (12:11 -0300)
committerThiago Santos <thiago.sousa.santos@collabora.com>
Mon, 2 Sep 2013 15:11:25 +0000 (12:11 -0300)
validate/gst/validate/gst-validate-element-monitor.c

index 39d1f54..b1983a8 100644 (file)
@@ -132,9 +132,12 @@ gst_validate_element_monitor_inspect (GstValidateElementMonitor * monitor)
 
   klassname =
       gst_element_class_get_metadata (klass, GST_ELEMENT_METADATA_KLASS);
-  monitor->is_decoder = strstr (klassname, "Decoder") != NULL;
-  monitor->is_encoder = strstr (klassname, "Encoder") != NULL;
-  monitor->is_demuxer = strstr (klassname, "Demuxer") != NULL;
+  if (klassname) {
+    monitor->is_decoder = strstr (klassname, "Decoder") != NULL;
+    monitor->is_encoder = strstr (klassname, "Encoder") != NULL;
+    monitor->is_demuxer = strstr (klassname, "Demuxer") != NULL;
+  } else
+    GST_ERROR_OBJECT (element, "no klassname");
 }
 
 static gboolean