[gimp] Issue #2685: Crash when distributing layers horizontally.
- From: Jehan <jehanp src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp] Issue #2685: Crash when distributing layers horizontally.
- Date: Wed, 10 Jul 2019 15:19:53 +0000 (UTC)
commit a6ad02a60a35cef748b02e1cf09804a5375b447c
Author: Jehan <jehan girinstud io>
Date: Wed Jul 10 17:15:12 2019 +0200
Issue #2685: Crash when distributing layers horizontally.
Make the returned values of g_list_length() a gint to avoid implicit
type conversion converting a possibly negative integer numberator into
unsigned int (which ends as a huge unsigned int instead of being
negative).
Found by Massimo!
app/core/gimpimage-arrange.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/app/core/gimpimage-arrange.c b/app/core/gimpimage-arrange.c
index 9d7021055a..6b6b05ee82 100644
--- a/app/core/gimpimage-arrange.c
+++ b/app/core/gimpimage-arrange.c
@@ -158,14 +158,14 @@ gimp_image_arrange_objects (GimpImage *image,
(reference, "align-width"));
/* The offset parameter works as an internal margin */
fill_offset = (distr_width - 2 * offset) /
- g_list_length (object_list);
+ (gint) g_list_length (object_list);
}
if (reference_alignment == GIMP_ARRANGE_VFILL)
{
distr_height = GPOINTER_TO_INT (g_object_get_data
(reference, "align-height"));
fill_offset = (distr_height - 2 * offset) /
- g_list_length (object_list);
+ (gint) g_list_length (object_list);
}
/* FIXME: undo group type is wrong */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]