[gimp] app: fix #6961 Scaled image bug
- From: Jacob Boerema <jboerema src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp] app: fix #6961 Scaled image bug
- Date: Sat, 28 May 2022 16:15:15 +0000 (UTC)
commit ba841a98dacf3a99dc7446ca78a94e1600e32b72
Author: Jacob Boerema <jgboerema gmail com>
Date: Sat May 28 12:13:44 2022 -0400
app: fix #6961 Scaled image bug
With large image sizes a 32-bit int is not enough for the intermediate
computations, which byte per pixel, width and height are.
So, just like the function below it does: gimp_gegl_pyramid_get_memsize,
we will cast these to gint64.
Thanks to Massimo Valentini for finding the cause.
app/core/gimp-memsize.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/app/core/gimp-memsize.c b/app/core/gimp-memsize.c
index 2826bda6da..fc674d0842 100644
--- a/app/core/gimp-memsize.c
+++ b/app/core/gimp-memsize.c
@@ -285,9 +285,9 @@ gimp_gegl_buffer_get_memsize (GeglBuffer *buffer)
{
const Babl *format = gegl_buffer_get_format (buffer);
- return (babl_format_get_bytes_per_pixel (format) *
- gegl_buffer_get_width (buffer) *
- gegl_buffer_get_height (buffer) +
+ return ((gint64) babl_format_get_bytes_per_pixel (format) *
+ (gint64) gegl_buffer_get_width (buffer) *
+ (gint64) gegl_buffer_get_height (buffer) +
gimp_g_object_get_memsize (G_OBJECT (buffer)));
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]