Commit 4f27efc4 authored by Ell's avatar Ell

Issue #2436 - Crash after downsizing canvas

In gimp_view_renderer_drawable_render(), avoid overflow in preview-
area calculation.  This prevents erroneously setting 'scaling_up'
to FALSE while upscaling the drawable by a very large amount, which
can lead to the creation of a very large GimpTempBuf for the
preview, causing memory allocation to fail.

(cherry picked from commit 0cdbe91e5ad0ae22e69ef5eb4f8e76a80c99a724)
parent 9dadd2ad
......@@ -234,8 +234,9 @@ gimp_view_renderer_drawable_render (GimpViewRenderer *renderer,
&scaling_up);
}
if ((view_width * view_height) <
(gimp_item_get_width (item) * gimp_item_get_height (item) * 4))
if (((gint64) view_width * (gint64) view_height) <
((gint64) gimp_item_get_width (item) *
(gint64) gimp_item_get_height (item) * 4))
scaling_up = FALSE;
if (scaling_up && image && ! renderer->is_popup)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment