Browse Source

Merge pull request #2097 from rfht/main

avoid segfault on OpenBSD by not accessing array at index -1
Sasha Szpakowski 10 months ago
parent
commit
b2785df437
1 changed files with 1 additions and 1 deletions
  1. 1 1
      src/modules/graphics/Polyline.cpp

+ 1 - 1
src/modules/graphics/Polyline.cpp

@@ -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];