From bdf4cf51b8ab75d13e3c9562141a6a1bf320b4ba Mon Sep 17 00:00:00 2001 From: Alex Date: Sat, 17 Sep 2022 21:16:10 +0300 Subject: [PATCH] Add a missing statement in segments reservation. Also adds an assert in FinishItem. Fixes https://gitlab.com/kicad/code/kicad/issues/12448 --- common/gal/opengl/opengl_gal.cpp | 1 + common/gal/opengl/vertex_manager.cpp | 2 ++ 2 files changed, 3 insertions(+) diff --git a/common/gal/opengl/opengl_gal.cpp b/common/gal/opengl/opengl_gal.cpp index e9552e47ab..c28ab26766 100644 --- a/common/gal/opengl/opengl_gal.cpp +++ b/common/gal/opengl/opengl_gal.cpp @@ -2228,6 +2228,7 @@ void OPENGL_GAL::drawSegmentChain( const std::function& aPointG if( startx == endx || starty == endy ) { vertices += 3; // One circle + continue; } if( m_isFillEnabled || aWidth == 1.0 ) diff --git a/common/gal/opengl/vertex_manager.cpp b/common/gal/opengl/vertex_manager.cpp index 09b3fb78b2..418d9b0645 100644 --- a/common/gal/opengl/vertex_manager.cpp +++ b/common/gal/opengl/vertex_manager.cpp @@ -167,6 +167,8 @@ void VERTEX_MANAGER::SetItem( VERTEX_ITEM& aItem ) const void VERTEX_MANAGER::FinishItem() const { + assert( m_reservedSpace == 0 && m_reserved == nullptr ); + m_container->FinishItem(); }