From cd0031be470328b8d33c38894de590addfce851a Mon Sep 17 00:00:00 2001 From: Tomasz Wlostowski Date: Mon, 12 Oct 2015 10:02:03 +0200 Subject: [PATCH] router: fix segfault when placing a via with failed shove of head trace --- pcbnew/router/pns_line_placer.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pcbnew/router/pns_line_placer.cpp b/pcbnew/router/pns_line_placer.cpp index aa864e149d..bdc29706f5 100644 --- a/pcbnew/router/pns_line_placer.cpp +++ b/pcbnew/router/pns_line_placer.cpp @@ -454,6 +454,12 @@ bool PNS_LINE_PLACER::rhShoveOnly( const VECTOR2I& aP, PNS_LINE& aNewHead ) l.Line().Append( l2.CLine() ); l.Line().Simplify(); + if( l.PointCount() == 0 || l2.PointCount() == 0 ) + { + aNewHead = m_head; + return false; + } + if( m_placingVia && viaOk ) { PNS_VIA v1( makeVia( l.CPoint( -1 ) ) ); @@ -1037,6 +1043,8 @@ bool PNS_LINE_PLACER::buildInitialLine( const VECTOR2I& aP, PNS_LINE& aHead ) { SHAPE_LINE_CHAIN l; + printf("H-net %d\n", aHead.Net()); + if( m_p_start == aP ) { l.Clear();