mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 20:21:24 +00:00
frei0r: Make sure to only register plugins that have valid propert types
This commit is contained in:
parent
abffe58d43
commit
b30ebf0108
1 changed files with 15 additions and 0 deletions
|
@ -424,6 +424,7 @@ register_plugin (GstPlugin * plugin, const gchar * filename)
|
||||||
GModule *module;
|
GModule *module;
|
||||||
gboolean ret = FALSE;
|
gboolean ret = FALSE;
|
||||||
GstFrei0rFuncTable ftable = { NULL, };
|
GstFrei0rFuncTable ftable = { NULL, };
|
||||||
|
gint i;
|
||||||
f0r_plugin_info_t info = { NULL, };
|
f0r_plugin_info_t info = { NULL, };
|
||||||
|
|
||||||
GST_DEBUG ("Registering plugin '%s'", filename);
|
GST_DEBUG ("Registering plugin '%s'", filename);
|
||||||
|
@ -476,6 +477,17 @@ register_plugin (GstPlugin * plugin, const gchar * filename)
|
||||||
return FALSE;
|
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) {
|
switch (info.plugin_type) {
|
||||||
case F0R_PLUGIN_TYPE_FILTER:
|
case F0R_PLUGIN_TYPE_FILTER:
|
||||||
ret = gst_frei0r_filter_register (plugin, &info, &ftable);
|
ret = gst_frei0r_filter_register (plugin, &info, &ftable);
|
||||||
|
@ -491,6 +503,9 @@ register_plugin (GstPlugin * plugin, const gchar * filename)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!ret)
|
||||||
|
goto invalid_frei0r_plugin;
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
invalid_frei0r_plugin:
|
invalid_frei0r_plugin:
|
||||||
|
|
Loading…
Reference in a new issue