From 7672a4f06b21a1550f534b7784bb5ddb6136f757 Mon Sep 17 00:00:00 2001 From: thfrwn <11335318+rfht@users.noreply.github.com> Date: Fri, 30 Aug 2024 08:10:16 -0400 Subject: [PATCH] avoid accessing array at index -1 --- src/modules/graphics/Polyline.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/graphics/Polyline.cpp b/src/modules/graphics/Polyline.cpp index e768687c4..90251e68a 100644 --- a/src/modules/graphics/Polyline.cpp +++ b/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];