From aaba366f0c8de348e7aae116c12c5d12e0a85b45 Mon Sep 17 00:00:00 2001 From: Anders Jonsson Date: Mon, 25 Mar 2024 18:45:49 +0100 Subject: [PATCH] plug-ins: avoid blinds crash by allowing MAX_FANS segments In GIMP 2.10 the number of segments was restricted to MAX_FANS. That was later changed to 1024 without increasing MAX_FANS which can crash the plug-in. Also change the max displacement angle back to 90 degrees. The interval 0 to 90 degrees is enough to return all possible values. Fixes #11108 --- plug-ins/common/blinds.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plug-ins/common/blinds.c b/plug-ins/common/blinds.c index d10f3ba28f..c7db6e1714 100644 --- a/plug-ins/common/blinds.c +++ b/plug-ins/common/blinds.c @@ -44,7 +44,7 @@ #define PLUG_IN_BINARY "blinds" #define PLUG_IN_ROLE "gimp-blinds" -#define MAX_FANS 100 +#define MAX_FANS 1024 typedef struct _Blinds Blinds; @@ -153,13 +153,13 @@ blinds_create_procedure (GimpPlugIn *plug_in, GIMP_PROC_ARG_INT (procedure, "angle-displacement", _("_Displacement"), _("Angle of Displacement"), - 0, 360, 30, + 0, 90, 30, G_PARAM_READWRITE); GIMP_PROC_ARG_INT (procedure, "num-segments", _("_Number of segments"), _("Number of segments in blinds"), - 1, 1024, 3, + 1, MAX_FANS, 3, G_PARAM_READWRITE); GIMP_PROC_ARG_INT (procedure, "orientation",