Skip to content

Commit

Permalink
avoid accessing array at index -1
Browse files Browse the repository at this point in the history
  • Loading branch information
rfht committed Aug 30, 2024
1 parent d1e58ab commit 7672a4f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/modules/graphics/Polyline.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down

0 comments on commit 7672a4f

Please sign in to comment.