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
This commit is contained in:
Anders Jonsson 2024-03-25 18:45:49 +01:00
parent 8c3cce1737
commit aaba366f0c

View file

@ -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",