From 06243e4d45ba6a53eae800fb74970df535ef4b65 Mon Sep 17 00:00:00 2001 From: elasota Date: Tue, 21 Jan 2020 00:21:11 -0500 Subject: [PATCH] Fix potential off-by-one --- PortabilityLayer/EllipsePlotter.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PortabilityLayer/EllipsePlotter.cpp b/PortabilityLayer/EllipsePlotter.cpp index 0361f84..5aac658 100644 --- a/PortabilityLayer/EllipsePlotter.cpp +++ b/PortabilityLayer/EllipsePlotter.cpp @@ -418,7 +418,7 @@ namespace PortabilityLayer // Since the algorithm here is based on cost minimization, it is allowed to intersect the ellipse if the start and end points // are both on or outside of the ellipse, so this violates the invariants. // Therefore, we need to decrement X until this is not the case. - while (m_xChangeCostDynamicFactor - m_xChangeCostStaticFactor < m_sqDistFromEdge) + while (m_xChangeCostDynamicFactor - m_xChangeCostStaticFactor <= m_sqDistFromEdge) DecrementX(); } }