From 16fccf325d72325a695ccef8bd3fc44978025c46 Mon Sep 17 00:00:00 2001 From: David Schleef Date: Wed, 29 Oct 2003 23:10:49 +0000 Subject: [PATCH] Allow NULL to be a valid value for factory->extensions. Original commit message from CVS: Allow NULL to be a valid value for factory->extensions. --- gst/gsttypefind.c | 3 ++- gst/registries/gstxmlregistry.c | 8 +++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/gst/gsttypefind.c b/gst/gsttypefind.c index 77677d362a..b87d4fd70a 100644 --- a/gst/gsttypefind.c +++ b/gst/gsttypefind.c @@ -159,7 +159,8 @@ gst_type_find_factory_get_caps (const GstTypeFindFactory *factory) * * Gets the extensions associated with a typefind factory. The returned * array should not be changed. If you need to change stuff in it, you should - * copy it using g_stdupv(). + * copy it using g_stdupv(). This function may return NULL to indicate + * a 0-length list. * * Returns: a NULL-terminated array of extensions associated with this factory */ diff --git a/gst/registries/gstxmlregistry.c b/gst/registries/gstxmlregistry.c index ca6b9f76da..3f5493fb62 100644 --- a/gst/registries/gstxmlregistry.c +++ b/gst/registries/gstxmlregistry.c @@ -1490,9 +1490,11 @@ gst_xml_registry_save_feature (GstXMLRegistry *xmlregistry, GstPluginFeature *fe gst_xml_registry_save_caps (xmlregistry, factory->caps); CLASS (xmlregistry)->save_func (xmlregistry, "\n"); } */ - while (factory->extensions[i]) { - PUT_ESCAPED ("extension", factory->extensions[i]); - i++; + if (factory->extensions) { + while (factory->extensions[i]) { + PUT_ESCAPED ("extension", factory->extensions[i]); + i++; + } } } else if (GST_IS_SCHEDULER_FACTORY (feature)) {