From a2bd03a471b72a121fe0fbd18d0786d254fe1872 Mon Sep 17 00:00:00 2001 From: Jacob Boerema Date: Fri, 13 Jun 2025 12:15:06 -0400 Subject: [PATCH] app: use GIMP_BRUSH_MAX_SIZE instead of a fixed number... to check for the maximum allowed size of a Photoshop brush. --- app/core/gimpbrush-load.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/app/core/gimpbrush-load.c b/app/core/gimpbrush-load.c index a90d9e188b..6653bfacb3 100644 --- a/app/core/gimpbrush-load.c +++ b/app/core/gimpbrush-load.c @@ -687,9 +687,9 @@ gimp_brush_load_abr_brush_v12 (GDataInputStream *input, /* g_print ("width %i height %i bytes %i\n", width, height, bytes); */ - if (width < 1 || width > 10000 || - height < 1 || height > 10000 || - bytes < 1 || bytes > 1 || + if (width < 1 || width > GIMP_BRUSH_MAX_SIZE || + height < 1 || height > GIMP_BRUSH_MAX_SIZE || + bytes < 1 || bytes > 1 || G_MAXSIZE / width / height / bytes < 1) { g_set_error (error, GIMP_DATA_ERROR, GIMP_DATA_ERROR_READ, @@ -876,10 +876,10 @@ gimp_brush_load_abr_brush_v6 (GDataInputStream *input, width, height, depth, compress); #endif - if (width < 1 || width > 10000 || - height < 1 || height > 10000 || - (compress && depth != 1) || - (! compress && (depth < 1 || depth > 2)) || + if (width < 1 || width > GIMP_BRUSH_MAX_SIZE || + height < 1 || height > GIMP_BRUSH_MAX_SIZE || + (compress && depth != 1) || + (! compress && (depth < 1 || depth > 2)) || G_MAXSIZE / width / height / depth < 1) { g_set_error (error, GIMP_DATA_ERROR, GIMP_DATA_ERROR_READ,