Commit a6ad02a6 authored by Jehan's avatar Jehan

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

Found by Massimo!
parent b3f7f36b
......@@ -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 */
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