Issue #12039: do not set NULL to the first non-standard plug-in arg.

We had special code to pass around a special config object for some
filters but it was just looking if this first "non-standard" (after run
mode, image, drawables…) was an object and inserting the settings
object, which turns out to be NULL in most case (except for these
special filters from the filters_settings_actions list).

This is not right, first because we may override the default value in
such case, second because, even if this arg may be overrided later
depending on run mode, it is possible that this random other
(non-config) argument may not even allow NULL to begin with. This was
what was happening in #12039.
This commit is contained in:
Jehan
2025-01-14 00:00:29 +01:00
parent e51b84e77b
commit d42c76cf09

View File

@ -24,6 +24,8 @@
#include "actions-types.h"
#include "operations/gimpoperationsettings.h"
#include "core/gimp.h"
#include "core/gimpimage.h"
#include "core/gimpdrawable.h"
@ -309,9 +311,13 @@ procedure_commands_get_display_args (GimpProcedure *procedure,
}
}
/* Some filters have a settings object (see filters_settings_actions
* list), which we want to pass around, but we don't want to pass
* other types of object data.
*/
if (gimp_value_array_length (args) > n_args &&
g_type_is_a (G_PARAM_SPEC_VALUE_TYPE (procedure->args[n_args]),
GIMP_TYPE_OBJECT))
GIMP_TYPE_OPERATION_SETTINGS))
{
g_value_set_object (gimp_value_array_index (args, n_args), settings);
n_args++;