[gimp] libgimpconfig: allow gimp_config_type_register() with 0 pspecs.



commit 5c7d6da1c3b72b12888a79fbeac2cac5e3748047
Author: Jehan <jehan girinstud io>
Date:   Tue Sep 17 12:55:04 2019 +0200

    libgimpconfig: allow gimp_config_type_register() with 0 pspecs.
    
    There is at least one valid case of a config type registration with no
    parameters: when registering the gegl:nop operation. This is the default
    case when running the GEGL operation tool. See implementation of
    gimp_filter_tool_get_operation().
    Therefore we ended up crashing GIMP just by calling this tool.

 libgimpconfig/gimpconfig-register.c | 2 --
 1 file changed, 2 deletions(-)
---
diff --git a/libgimpconfig/gimpconfig-register.c b/libgimpconfig/gimpconfig-register.c
index 4eaef927f4..4fb0154839 100644
--- a/libgimpconfig/gimpconfig-register.c
+++ b/libgimpconfig/gimpconfig-register.c
@@ -84,7 +84,6 @@ gimp_config_type_register (GType         parent_type,
   g_return_val_if_fail (g_type_is_a (parent_type, G_TYPE_OBJECT), G_TYPE_NONE);
   g_return_val_if_fail (type_name != NULL, G_TYPE_NONE);
   g_return_val_if_fail (pspecs != NULL, G_TYPE_NONE);
-  g_return_val_if_fail (n_pspecs > 0, G_TYPE_NONE);
 
   terminated_pspecs = g_new0 (GParamSpec *, n_pspecs + 1);
 
@@ -115,7 +114,6 @@ gimp_config_type_register (GType         parent_type,
 
     config_type = g_type_register_static (parent_type, type_name,
                                           &info, 0);
-
     g_type_add_interface_static (config_type, GIMP_TYPE_CONFIG,
                                  &config_info);
   }


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