mirror of https://github.com/GNOME/gimp.git
plug-ins: fix possible integer overflow on large images in jigsaw
Make sure we use gsize for intermediate results to not get integer overflow on large image sizes. This still is not ideal, but better than a crash, since we may (try to) allocate a very large block of memory, which we should eventually fix by looping over smaller size buffers.
This commit is contained in:
parent
97a71cfd41
commit
bbbd149ba3
|
@ -560,7 +560,7 @@ jigsaw (GObject *config,
|
|||
bytes = babl_format_get_bytes_per_pixel (format);
|
||||
|
||||
/* setup image buffer */
|
||||
buffer_size = bytes * width * height;
|
||||
buffer_size = (gsize) bytes * width * height;
|
||||
buffer = g_new (guchar, buffer_size);
|
||||
|
||||
gegl_buffer_get (gegl_buffer, GEGL_RECTANGLE (0, 0, width, height), 1.0,
|
||||
|
|
Loading…
Reference in New Issue