router: prevent heap crash when initial walkaround line is empty

This commit is contained in:
Tomasz Wlostowski 2020-07-22 23:06:53 +02:00
parent 1a2e02040a
commit c2b9db293f
1 changed files with 14 additions and 11 deletions

View File

@ -63,6 +63,8 @@ WALKAROUND::WALKAROUND_STATUS WALKAROUND::singleStep( LINE& aPath,
SHAPE_LINE_CHAIN path_pre[2], path_walk[2], path_post[2];
if( aPath.PointCount() > 1 )
{
VECTOR2I last = aPath.CPoint( -1 );
if( ( current_obs->m_hull ).PointInside( last ) || ( current_obs->m_hull ).PointOnEdge( last ) )
@ -77,6 +79,7 @@ WALKAROUND::WALKAROUND_STATUS WALKAROUND::singleStep( LINE& aPath,
return DONE;
}
}
}
aPath.Walkaround( current_obs->m_hull, path_pre[0], path_walk[0],
path_post[0], aWindingDirection );