From fb1cc720138f7bce43b18ba71188dddd8eb60122 Mon Sep 17 00:00:00 2001 From: Mark Roszko Date: Wed, 12 Apr 2023 01:41:06 +0000 Subject: [PATCH] Don't crash on empty pcad polygons Fixes sentry KICAD-103 --- pcbnew/plugins/pcad/pcb_copper_pour.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pcbnew/plugins/pcad/pcb_copper_pour.cpp b/pcbnew/plugins/pcad/pcb_copper_pour.cpp index 4075c03fbd..f59a3fc1d1 100644 --- a/pcbnew/plugins/pcad/pcb_copper_pour.cpp +++ b/pcbnew/plugins/pcad/pcb_copper_pour.cpp @@ -94,6 +94,12 @@ bool PCB_COPPER_POUR::Parse( XNODE* aNode, const wxString& aDefaultUnits, // retrieve copper pour outline FormPolygon( lNode, &m_outline, aDefaultUnits, aActualConversion ); + if( m_outline.GetCount() == 0 ) + { + // empty polygon may have been in the file + return false; + } + m_positionX = m_outline[0]->x; m_positionY = m_outline[0]->y; }