libvgcode - Fixed potential out of bound access in ViewerImpl::update_view_full_range()

This commit is contained in:
enricoturri1966 2024-03-15 10:57:43 +01:00 committed by Lukas Matena
parent c2b8914ed0
commit c3120b038a

View File

@ -1668,7 +1668,7 @@ void ViewerImpl::update_view_full_range()
}
// If the first vertex is an extrusion, add an extra step to properly detect the first segment
if (first_it != m_vertices.begin() && first_it->type == EMoveType::Extrude)
if (first_it != m_vertices.begin() && first_it != m_vertices.end() && first_it->type == EMoveType::Extrude)
--first_it;
if (first_it == m_vertices.end())