[gimp/gimp-2-10] Issue #2635 - Segfault when using measuring tool
- From: Ell <ell src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp/gimp-2-10] Issue #2635 - Segfault when using measuring tool
- Date: Sat, 8 Dec 2018 11:08:10 +0000 (UTC)
commit a2c20b15392d456b36afdc9074d1176f02403b29
Author: Ell <ell_se yahoo com>
Date: Sat Dec 8 05:59:05 2018 -0500
Issue #2635 - Segfault when using measuring tool
In gimp_tool_compass_update_angle(), use fuzzy comparisson when
determining whether to update the angle properties, to avoid
infinite recursion due to floating-point inaccuracies. In
partcicular, on x86, when using the x87 FPU rather than SSE, the
floating-point registers are 80-bit, while the properties are
stored as 64-bit, which can create small discrepancies between the
calculated angles and the stored values.
(cherry picked from commit ad831dbc6d4a0ac0ad05b0b17f94373605692d61)
app/display/gimptoolcompass.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/app/display/gimptoolcompass.c b/app/display/gimptoolcompass.c
index 626195c148..28e7d43b54 100644
--- a/app/display/gimptoolcompass.c
+++ b/app/display/gimptoolcompass.c
@@ -1155,14 +1155,14 @@ gimp_tool_compass_update_angle (GimpToolCompass *compass,
}
}
- if (pixel_angle != private->pixel_angle)
+ if (fabs (pixel_angle - private->pixel_angle) > EPSILON)
{
private->pixel_angle = pixel_angle;
g_object_notify (G_OBJECT (compass), "pixel-angle");
}
- if (unit_angle != private->unit_angle)
+ if (fabs (unit_angle - private->unit_angle) > EPSILON)
{
private->unit_angle = unit_angle;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]