From fb58e16c5a0e1a21c698139436471dec1c5176c0 Mon Sep 17 00:00:00 2001 From: Edward Hervey Date: Mon, 2 Sep 2013 12:11:25 -0300 Subject: [PATCH] element-monitor: protect agains elements that have no klass --- validate/gst/validate/gst-validate-element-monitor.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/validate/gst/validate/gst-validate-element-monitor.c b/validate/gst/validate/gst-validate-element-monitor.c index 39d1f54..b1983a8 100644 --- a/validate/gst/validate/gst-validate-element-monitor.c +++ b/validate/gst/validate/gst-validate-element-monitor.c @@ -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 -- 2.7.4