router: fix segfault when placing a via with failed shove of head trace

This commit is contained in:
Tomasz Wlostowski 2015-10-12 10:02:03 +02:00 committed by Maciej Suminski
parent cb6ea1ed13
commit cd0031be47
1 changed files with 8 additions and 0 deletions

View File

@ -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();