router: fix array out-of-bound error in HullIntersection()

fixes: https://gitlab.com/kicad/code/kicad/-/issues/8538
This commit is contained in:
Tomasz Wlostowski 2021-06-03 22:33:38 +02:00
parent 3e98c44636
commit a744857267
1 changed files with 5 additions and 2 deletions

View File

@ -271,7 +271,7 @@ void HullIntersection( const SHAPE_LINE_CHAIN& hull, const SHAPE_LINE_CHAIN& lin
hull.Intersect( line, ips_raw );
for( const auto& p : ips_raw )
for( auto& p : ips_raw )
{
SHAPE_LINE_CHAIN::INTERSECTION ipp;
@ -289,6 +289,9 @@ void HullIntersection( const SHAPE_LINE_CHAIN& hull, const SHAPE_LINE_CHAIN& lin
continue;
}
if( p.index_our >= hull.SegmentCount() )
p.index_our -= hull.SegmentCount();
if( p.is_corner_our )
{
d1[0] = hull.CSegment( p.index_our );