Commit 0cdbe91e 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.
parent 3dea26b6
......@@ -234,8 +234,9 @@ gimp_view_renderer_drawable_render (GimpViewRenderer *renderer,
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