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.
This commit is contained in:
Jacob Boerema
2022-05-28 12:13:44 -04:00
parent dbd4751a0a
commit ba841a98da

View File

@ -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)));
}