actions: Fix missing argument length check

Resolves #14192
In procedure_commands_get_display_args (), one
section missed a check for the argument array length
before trying to access the index. This caused a crash
if there were not enough arguments sent in for a Script-fu
plug-in. This patch adds that array length check to prevent
the crash.
This commit is contained in:
Alx Sa 2025-06-04 13:52:55 +00:00
parent 20fb40f7d7
commit 6192b79d89

View file

@ -289,14 +289,14 @@ procedure_commands_get_display_args (GimpProcedure *procedure,
return NULL;
}
}
else if (GIMP_IS_PARAM_SPEC_CORE_OBJECT_ARRAY (procedure->args[n_args]))
else if (gimp_value_array_length (args) > n_args &&
GIMP_IS_PARAM_SPEC_CORE_OBJECT_ARRAY (procedure->args[n_args]))
{
GimpDrawable **drawables = NULL;
gint n_drawables;
GList *iter;
gint i;
n_drawables = g_list_length (drawables_list);
drawables = g_new0 (GimpDrawable *, n_drawables + 1);