From b1878fcc549685c86d27e8e7a251ae0ee7a9806a Mon Sep 17 00:00:00 2001 From: Jon Evans Date: Sun, 21 Nov 2021 11:03:22 -0500 Subject: [PATCH] ClipVertexRange: fix fallout of NextShape API change Fixes https://gitlab.com/kicad/code/kicad/-/issues/9711 --- pcbnew/router/pns_line.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pcbnew/router/pns_line.cpp b/pcbnew/router/pns_line.cpp index 7b1fefcff0..5447d354f0 100644 --- a/pcbnew/router/pns_line.cpp +++ b/pcbnew/router/pns_line.cpp @@ -1079,12 +1079,11 @@ void LINE::ClipVertexRange( int aStart, int aEnd ) */ int firstLink = 0; int lastLink = std::max( 0, static_cast( m_links.size() ) - 1 ); - int arcIdx = -1; int linkIdx = 0; int numPoints = static_cast( m_line.PointCount() ); - for( int i = 0; i < m_line.PointCount(); i = m_line.NextShape( i ) ) + for( int i = 0; i >= 0 && i < m_line.PointCount(); i = m_line.NextShape( i ) ) { if( i <= aStart ) firstLink = linkIdx;