SHAPE_LINE_CHAIN: Don't crash if inserting point at the end

This commit is contained in:
Jon Evans 2021-04-04 19:12:20 -04:00
parent bd6539885b
commit 5bc1e55272
1 changed files with 1 additions and 1 deletions

View File

@ -631,7 +631,7 @@ void SHAPE_LINE_CHAIN::Append( const SHAPE_ARC& aArc )
void SHAPE_LINE_CHAIN::Insert( size_t aVertex, const VECTOR2I& aP )
{
if( m_shapes[aVertex] != SHAPE_IS_PT )
if( aVertex < m_points.size() && m_shapes[aVertex] != SHAPE_IS_PT )
convertArc( aVertex );
m_points.insert( m_points.begin() + aVertex, aP );