From 21830d66c6d1a0b3681c77fd80763ee1ccb0e4bb Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Mon, 10 Dec 2012 11:55:42 +0100 Subject: [PATCH] plugin: protect against NULL filename in debug See https://bugzilla.gnome.org/show_bug.cgi?id=689948 --- gst/gstplugin.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/gst/gstplugin.c b/gst/gstplugin.c index ebeee94..1a62cf3 100644 --- a/gst/gstplugin.c +++ b/gst/gstplugin.c @@ -481,7 +481,7 @@ gst_plugin_register_func (GstPlugin * plugin, const GstPluginDesc * desc, if (!gst_plugin_check_version (desc->major_version, desc->minor_version)) { if (GST_CAT_DEFAULT) GST_WARNING ("plugin \"%s\" has incompatible version, not loading", - plugin->filename); + GST_STR_NULL (plugin->filename)); return NULL; } @@ -489,14 +489,14 @@ gst_plugin_register_func (GstPlugin * plugin, const GstPluginDesc * desc, !desc->package || !desc->origin) { if (GST_CAT_DEFAULT) GST_WARNING ("plugin \"%s\" has incorrect GstPluginDesc, not loading", - plugin->filename); + GST_STR_NULL (plugin->filename)); return NULL; } if (!gst_plugin_check_license (desc->license)) { if (GST_CAT_DEFAULT) GST_WARNING ("plugin \"%s\" has invalid license \"%s\", not loading", - plugin->filename, desc->license); + GST_STR_NULL (plugin->filename), desc->license); return NULL; } @@ -514,13 +514,15 @@ gst_plugin_register_func (GstPlugin * plugin, const GstPluginDesc * desc, if (user_data) { if (!(((GstPluginInitFullFunc) (desc->plugin_init)) (plugin, user_data))) { if (GST_CAT_DEFAULT) - GST_WARNING ("plugin \"%s\" failed to initialise", plugin->filename); + GST_WARNING ("plugin \"%s\" failed to initialise", + GST_STR_NULL (plugin->filename)); return NULL; } } else { if (!((desc->plugin_init) (plugin))) { if (GST_CAT_DEFAULT) - GST_WARNING ("plugin \"%s\" failed to initialise", plugin->filename); + GST_WARNING ("plugin \"%s\" failed to initialise", + GST_STR_NULL (plugin->filename)); return NULL; } } -- 2.7.4