OPENGL GAL: Fixed the iteration condition when drawing triangulated polyset
The loop used an incorrect variable size as the loop limit, occasionally causing out of bounds accesses. Fixes: lp:1778288 * https://bugs.launchpad.net/kicad/+bug/1778288
This commit is contained in:
parent
1751e4631c
commit
73a8d2a9d5
|
@ -805,7 +805,7 @@ void OPENGL_GAL::drawTriangulatedPolyset( const SHAPE_POLY_SET& aPolySet )
|
|||
|
||||
if( isFillEnabled )
|
||||
{
|
||||
for( int j = 0; j < aPolySet.OutlineCount(); ++j )
|
||||
for( unsigned int j = 0; j < aPolySet.TriangulatedPolyCount(); ++j )
|
||||
{
|
||||
auto triPoly = aPolySet.TriangulatedPolygon( j );
|
||||
|
||||
|
|
|
@ -548,6 +548,9 @@ class SHAPE_POLY_SET : public SHAPE
|
|||
*/
|
||||
bool IsSelfIntersecting();
|
||||
|
||||
///> Returns the number of triangulated polygons
|
||||
unsigned int TriangulatedPolyCount() const { return m_triangulatedPolys.size(); }
|
||||
|
||||
///> Returns the number of outlines in the set
|
||||
int OutlineCount() const { return m_polys.size(); }
|
||||
|
||||
|
|
Loading…
Reference in New Issue