From 67f0bbc6d767329a38d670e2feb1d942beaad8b6 Mon Sep 17 00:00:00 2001 From: Tomasz Wlostowski Date: Mon, 31 May 2021 00:20:32 +0200 Subject: [PATCH] router: fixed crash in HullIntersection() when the path has 0 or 1 points. fixes: 8515 --- pcbnew/router/pns_utils.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pcbnew/router/pns_utils.cpp b/pcbnew/router/pns_utils.cpp index 402bd6ae12..f155915461 100644 --- a/pcbnew/router/pns_utils.cpp +++ b/pcbnew/router/pns_utils.cpp @@ -266,6 +266,9 @@ void HullIntersection( const SHAPE_LINE_CHAIN& hull, const SHAPE_LINE_CHAIN& lin { SHAPE_LINE_CHAIN::INTERSECTIONS ips_raw; + if( line.PointCount() < 2 ) + return; + hull.Intersect( line, ips_raw ); for( const auto& p : ips_raw )