From 5c666e7f43984b33f4fabbd7e49f28bbb455693e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim-Philipp=20M=C3=BCller?= Date: Mon, 25 Sep 2006 11:16:37 +0000 Subject: [PATCH] gst/gsturi.c: Don't assert/crash here if a uri handler doesn't return any supported protocols. The list of protocols ... Original commit message from CVS: * gst/gsturi.c: (search_by_entry): Don't assert/crash here if a uri handler doesn't return any supported protocols. The list of protocols could be generated dynamically at runtime or at plugin registration, and an error in the underlying library shouldn't be fatal (#353301). --- ChangeLog | 8 ++++++++ gst/gsturi.c | 9 +++++++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 069d75437b..11760c1608 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2006-09-25 Tim-Philipp Müller + + * gst/gsturi.c: (search_by_entry): + Don't assert/crash here if a uri handler doesn't return any + supported protocols. The list of protocols could be generated + dynamically at runtime or at plugin registration, and an error + in the underlying library shouldn't be fatal (#353301). + 2006-09-25 Tim-Philipp Müller * gst/gstinfo.c: diff --git a/gst/gsturi.c b/gst/gsturi.c index c43dace3c1..ae2ca7a83c 100644 --- a/gst/gsturi.c +++ b/gst/gsturi.c @@ -475,8 +475,13 @@ search_by_entry (GstPluginFeature * feature, gpointer search_entry) return FALSE; protocols = gst_element_factory_get_uri_protocols (factory); - /* must be set when uri type is valid */ - g_assert (protocols); + + if (protocols == NULL) { + g_warning ("Factory '%s' implements GstUriHandler interface but returned " + "no supported protocols!", gst_plugin_feature_get_name (feature)); + return FALSE; + } + while (*protocols != NULL) { if (strcmp (*protocols, entry->protocol) == 0) return TRUE;