mirror of https://github.com/GNOME/gimp.git
it's a bad idea to access an array before checking if it's long enough.
2006-08-09 Michael Natterer <mitch@gimp.org> * app/plug-in/plug-in-params.c (plug_in_params_to_args): it's a bad idea to access an array before checking if it's long enough. Fixes bug #350555. Also added some comments, the logic here is really weird.
This commit is contained in:
parent
9d76a1734f
commit
262fce4dc2
|
@ -1,3 +1,10 @@
|
||||||
|
2006-08-09 Michael Natterer <mitch@gimp.org>
|
||||||
|
|
||||||
|
* app/plug-in/plug-in-params.c (plug_in_params_to_args): it's a
|
||||||
|
bad idea to access an array before checking if it's long enough.
|
||||||
|
Fixes bug #350555. Also added some comments, the logic here is
|
||||||
|
really weird.
|
||||||
|
|
||||||
2006-08-09 Sven Neumann <sven@gimp.org>
|
2006-08-09 Sven Neumann <sven@gimp.org>
|
||||||
|
|
||||||
* libgimpcolor/gimprgb.c
|
* libgimpcolor/gimprgb.c
|
||||||
|
|
|
@ -57,22 +57,35 @@ plug_in_params_to_args (GParamSpec **pspecs,
|
||||||
GType type;
|
GType type;
|
||||||
gint count;
|
gint count;
|
||||||
|
|
||||||
|
/* first get the fallback compat GType that matches the pdb type */
|
||||||
type = gimp_pdb_compat_arg_type_to_gtype (params[i].type);
|
type = gimp_pdb_compat_arg_type_to_gtype (params[i].type);
|
||||||
|
|
||||||
|
/* then try to try to be more specific by looking at the param
|
||||||
|
* spec (return values have one additional value (the status),
|
||||||
|
* skip that, it's not in the array of param specs)
|
||||||
|
*/
|
||||||
if (i > 0 || ! return_values)
|
if (i > 0 || ! return_values)
|
||||||
{
|
{
|
||||||
gint pspec_index = i;
|
gint pspec_index = i;
|
||||||
GimpPDBArgType pspec_arg_type;
|
|
||||||
|
|
||||||
if (return_values)
|
if (return_values)
|
||||||
pspec_index--;
|
pspec_index--;
|
||||||
|
|
||||||
pspec_arg_type = gimp_pdb_compat_arg_type_from_gtype
|
/* are there param specs left? */
|
||||||
(G_PARAM_SPEC_VALUE_TYPE (pspecs[pspec_index]));
|
if (pspec_index < n_pspecs)
|
||||||
|
|
||||||
if (pspec_index < n_pspecs && pspec_arg_type == params[i].type)
|
|
||||||
{
|
{
|
||||||
type = G_PARAM_SPEC_VALUE_TYPE (pspecs[pspec_index]);
|
GimpPDBArgType pspec_arg_type;
|
||||||
|
|
||||||
|
pspec_arg_type = gimp_pdb_compat_arg_type_from_gtype
|
||||||
|
(G_PARAM_SPEC_VALUE_TYPE (pspecs[pspec_index]));
|
||||||
|
|
||||||
|
/* if the param spec's GType, mapped to a pdb type, matches
|
||||||
|
* the passed pdb type, use the param spec's GType
|
||||||
|
*/
|
||||||
|
if (pspec_arg_type == params[i].type)
|
||||||
|
{
|
||||||
|
type = G_PARAM_SPEC_VALUE_TYPE (pspecs[pspec_index]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue