[gimp/gimp-2-10] Issue #2436 - Crash after downsizing canvas
- From: Ell <ell src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp/gimp-2-10] Issue #2436 - Crash after downsizing canvas
- Date: Sat, 3 Nov 2018 01:44:25 +0000 (UTC)
commit 4f27efc4a0b12dfa573691caf2bad374891d1d74
Author: Ell <ell_se yahoo com>
Date: Fri Nov 2 21:36:22 2018 -0400
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)
app/widgets/gimpviewrendererdrawable.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/app/widgets/gimpviewrendererdrawable.c b/app/widgets/gimpviewrendererdrawable.c
index 4b35ed1650..273ef92208 100644
--- a/app/widgets/gimpviewrendererdrawable.c
+++ b/app/widgets/gimpviewrendererdrawable.c
@@ -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)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]