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!
This commit is contained in:
@ -158,14 +158,14 @@ gimp_image_arrange_objects (GimpImage *image,
|
|||||||
(reference, "align-width"));
|
(reference, "align-width"));
|
||||||
/* The offset parameter works as an internal margin */
|
/* The offset parameter works as an internal margin */
|
||||||
fill_offset = (distr_width - 2 * offset) /
|
fill_offset = (distr_width - 2 * offset) /
|
||||||
g_list_length (object_list);
|
(gint) g_list_length (object_list);
|
||||||
}
|
}
|
||||||
if (reference_alignment == GIMP_ARRANGE_VFILL)
|
if (reference_alignment == GIMP_ARRANGE_VFILL)
|
||||||
{
|
{
|
||||||
distr_height = GPOINTER_TO_INT (g_object_get_data
|
distr_height = GPOINTER_TO_INT (g_object_get_data
|
||||||
(reference, "align-height"));
|
(reference, "align-height"));
|
||||||
fill_offset = (distr_height - 2 * offset) /
|
fill_offset = (distr_height - 2 * offset) /
|
||||||
g_list_length (object_list);
|
(gint) g_list_length (object_list);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* FIXME: undo group type is wrong */
|
/* FIXME: undo group type is wrong */
|
||||||
|
Reference in New Issue
Block a user