diff options
author | Sebastian Dröge <sebastian.droege@collabora.co.uk> | 2009-06-16 21:27:38 +0200 |
---|---|---|
committer | Sebastian Dröge <sebastian.droege@collabora.co.uk> | 2009-06-19 11:03:16 +0200 |
commit | b30ebf01080eb6def50207b3b595b7fb188b24c7 (patch) | |
tree | 8b7dabe1431e9379da8c47831fb214b34d4c1cae /gst | |
parent | abffe58d43ff68071e139fd9316da37a8b8f26c5 (diff) | |
download | gst-plugins-bad-b30ebf01080eb6def50207b3b595b7fb188b24c7.tar.gz gst-plugins-bad-b30ebf01080eb6def50207b3b595b7fb188b24c7.tar.bz2 gst-plugins-bad-b30ebf01080eb6def50207b3b595b7fb188b24c7.zip |
frei0r: Make sure to only register plugins that have valid propert types
Diffstat (limited to 'gst')
-rw-r--r-- | gst/frei0r/gstfrei0r.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/gst/frei0r/gstfrei0r.c b/gst/frei0r/gstfrei0r.c index 28eeb11d..f90f1d6f 100644 --- a/gst/frei0r/gstfrei0r.c +++ b/gst/frei0r/gstfrei0r.c @@ -424,6 +424,7 @@ register_plugin (GstPlugin * plugin, const gchar * filename) GModule *module; gboolean ret = FALSE; GstFrei0rFuncTable ftable = { NULL, }; + gint i; f0r_plugin_info_t info = { NULL, }; GST_DEBUG ("Registering plugin '%s'", filename); @@ -476,6 +477,17 @@ register_plugin (GstPlugin * plugin, const gchar * filename) return FALSE; } + for (i = 0; i < info.num_params; i++) { + f0r_param_info_t pinfo = { NULL, }; + + ftable.get_param_info (&pinfo, i); + if (pinfo.type > F0R_PARAM_STRING) { + GST_WARNING ("Unsupported parameter type %d", pinfo.type); + g_module_close (module); + return FALSE; + } + } + switch (info.plugin_type) { case F0R_PLUGIN_TYPE_FILTER: ret = gst_frei0r_filter_register (plugin, &info, &ftable); @@ -491,6 +503,9 @@ register_plugin (GstPlugin * plugin, const gchar * filename) break; } + if (!ret) + goto invalid_frei0r_plugin; + return ret; invalid_frei0r_plugin: |