[gimp] libgimp: fix wrong assert in gimp_procedure_config_set_values().



commit 707d3c6f6475e0b087b87185468d20c979be89b8
Author: Jehan <jehan girinstud io>
Date:   Wed Mar 18 20:33:55 2020 +0100

    libgimp: fix wrong assert in gimp_procedure_config_set_values().
    
    The first property of a GimpProcedureConfig is the related
    GimpProcedure. All others are the procedure arguments.
    Also fixing the pspecs index while looping since we want to start at 1
    to loop through arguments for the same reason.
    
    Among other things, this was breaking the calls to file_save() and
    several unit tests.
    
    (cherry picked from commit 48acb361a38cd5e5fd59f375d937910de2270dba)

 libgimp/gimpprocedureconfig.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/libgimp/gimpprocedureconfig.c b/libgimp/gimpprocedureconfig.c
index 9e6cab2831..1624490ce7 100644
--- a/libgimp/gimpprocedureconfig.c
+++ b/libgimp/gimpprocedureconfig.c
@@ -252,11 +252,12 @@ gimp_procedure_config_set_values (GimpProcedureConfig  *config,
   gimp_procedure_get_aux_arguments (config->priv->procedure, &n_aux_args);
   n_values = gimp_value_array_length (values);
 
-  g_return_if_fail (n_pspecs == n_values + n_aux_args);
+  /* The first property is the procedure, all others are arguments. */
+  g_return_if_fail (n_pspecs == n_values + n_aux_args + 1);
 
   for (i = 0; i < n_values; i++)
     {
-      GParamSpec *pspec = pspecs[i];
+      GParamSpec *pspec = pspecs[i + 1];
       GValue     *value = gimp_value_array_index (values, i);
 
       g_object_set_property (G_OBJECT (config), pspec->name, value);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]