From: <bi...@ke...> - 2009-10-19 11:29:07
|
Module: gstreamer Branch: master Commit: adfb63837c6e42b59025efbad03f2feb40fe00a9 URL: http://cgit.freedesktop.org/gstreamer/gstreamer/commit/?id=adfb63837c6e42b59025efbad03f2feb40fe00a9 Author: Edward Hervey <bi...@bi...> Date: Mon Oct 19 13:30:10 2009 +0200 tools/gst-inspect: Check we're not handling NULL pointers. --- tools/gst-inspect.c | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-) diff --git a/tools/gst-inspect.c b/tools/gst-inspect.c index 489ca13..8769ee4 100644 --- a/tools/gst-inspect.c +++ b/tools/gst-inspect.c @@ -992,6 +992,8 @@ print_element_list (gboolean print_all) while (features) { GstPluginFeature *feature; + if (G_UNLIKELY (features->data == NULL)) + goto next; feature = GST_PLUGIN_FEATURE (features->data); featurecount++; @@ -1040,6 +1042,7 @@ print_element_list (gboolean print_all) g_type_name (G_OBJECT_TYPE (feature))); } + next: features = g_list_next (features); } @@ -1203,7 +1206,7 @@ print_plugin_features (GstPlugin * plugin) gst_plugin_feature_get_name (feature)); num_typefinders++; - } else { + } else if (feature) { n_print (" %s (%s)\n", gst_object_get_name (GST_OBJECT (feature)), g_type_name (G_OBJECT_TYPE (feature))); num_other++; |