Fix crash when drawing a polygon with empty outline
In theory there should be no polygons with empty outline, but as you see there was at least one leading to a crash. Fixes: lp:1739455 * https://bugs.launchpad.net/kicad/+bug/1739455
This commit is contained in:
parent
5c6c60def4
commit
2fc07561f1
|
@ -822,6 +822,10 @@ void OPENGL_GAL::DrawPolygon( const SHAPE_POLY_SET& aPolySet )
|
|||
for( int j = 0; j < aPolySet.OutlineCount(); ++j )
|
||||
{
|
||||
const SHAPE_LINE_CHAIN& outline = aPolySet.COutline( j );
|
||||
|
||||
if( outline.SegmentCount() == 0 )
|
||||
continue;
|
||||
|
||||
const int pointCount = outline.SegmentCount() + 1;
|
||||
std::unique_ptr<GLdouble[]> points( new GLdouble[3 * pointCount] );
|
||||
GLdouble* ptr = points.get();
|
||||
|
|
Loading…
Reference in New Issue