Skip to content

Commit

Permalink
Merge pull request #2097 from rfht/main
Browse files Browse the repository at this point in the history
avoid segfault on OpenBSD by not accessing array at index -1
  • Loading branch information
slime73 authored Oct 22, 2024
2 parents 2655a42 + 7672a4f commit b2785df
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 b2785df

Please sign in to comment.