pcbnew: Fix polygon comparison () for end
This is a v5-only fix incorporating2c5876e
and72da237
into the 5 branch to resolve a crash when parsing invalid polygons. Fixes #3752 | https://gitlab.com/kicad/code/kicad/issues/3752
This commit is contained in:
parent
683c01b301
commit
3444409554
|
@ -165,7 +165,16 @@ class SHAPE_POLY_SET : public SHAPE
|
|||
|
||||
operator bool() const
|
||||
{
|
||||
return m_currentPolygon <= m_lastPolygon;
|
||||
if( m_currentPolygon < m_lastPolygon )
|
||||
return true;
|
||||
|
||||
if( m_currentPolygon != m_poly->OutlineCount() - 1 )
|
||||
return false;
|
||||
|
||||
const auto& currentPolygon = m_poly->CPolygon( m_currentPolygon );
|
||||
|
||||
return m_currentContour < (int) currentPolygon.size() - 1
|
||||
|| m_currentVertex < currentPolygon[m_currentContour].PointCount();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue