[gimp/wip/Jehan/make-check-CI-master] libgimp: fix wrong assert in gimp_procedure_config_set_values().



commit 48acb361a38cd5e5fd59f375d937910de2270dba
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.
    
    Among other things, this was breaking the calls to file_save() and
    several unit tests.

 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]