From 89ed09744b4abd7b3c202345386c4ac5ecd22e01 Mon Sep 17 00:00:00 2001 From: Alex Shvartzkop Date: Wed, 13 Mar 2024 02:49:31 +0300 Subject: [PATCH] Fix a crash in PNS zone sync when there's more outlines than triangulated polygons. Fixes https://gitlab.com/kicad/code/kicad/-/issues/17351 (cherry picked from commit b56ee20e22dde976b9b287403752fabcf20c2db2) --- pcbnew/router/pns_kicad_iface.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pcbnew/router/pns_kicad_iface.cpp b/pcbnew/router/pns_kicad_iface.cpp index ebfb314616..24969147ab 100644 --- a/pcbnew/router/pns_kicad_iface.cpp +++ b/pcbnew/router/pns_kicad_iface.cpp @@ -1274,9 +1274,9 @@ bool PNS_KICAD_IFACE_BASE::syncZone( PNS::NODE* aWorld, ZONE* aZone, SHAPE_POLY_ if( !layers[ layer ] ) continue; - for( int outline = 0; outline < poly->OutlineCount(); outline++ ) + for( int polyId = 0; polyId < poly->TriangulatedPolyCount(); polyId++ ) { - const SHAPE_POLY_SET::TRIANGULATED_POLYGON* tri = poly->TriangulatedPolygon( outline ); + const SHAPE_POLY_SET::TRIANGULATED_POLYGON* tri = poly->TriangulatedPolygon( polyId ); for( size_t i = 0; i < tri->GetTriangleCount(); i++) {