router: fixed crash in HullIntersection() when the path has 0 or 1 points.

fixes: 8515
This commit is contained in:
Tomasz Wlostowski 2021-05-31 00:20:32 +02:00
parent 614787caae
commit 67f0bbc6d7
1 changed files with 3 additions and 0 deletions

View File

@ -266,6 +266,9 @@ void HullIntersection( const SHAPE_LINE_CHAIN& hull, const SHAPE_LINE_CHAIN& lin
{ {
SHAPE_LINE_CHAIN::INTERSECTIONS ips_raw; SHAPE_LINE_CHAIN::INTERSECTIONS ips_raw;
if( line.PointCount() < 2 )
return;
hull.Intersect( line, ips_raw ); hull.Intersect( line, ips_raw );
for( const auto& p : ips_raw ) for( const auto& p : ips_raw )