Merge pull request #2097 from rfht/main

avoid segfault on OpenBSD by not accessing array at index -1
This commit is contained in:
Sasha Szpakowski
2024-10-21 22:08:05 -03:00
committed by GitHub
+1 -1
View File
@@ -100,7 +100,7 @@ void Polyline::render(const Vector2 *coords, size_t count, size_t size_hint, flo
}
// Add the degenerate triangle strip.
if (extra_vertices)
if (extra_vertices && vertex_count > 0)
{
vertices[vertex_count + 0] = vertices[vertex_count - 1];
vertices[vertex_count + 1] = vertices[overdraw_vertex_start];