mirror of
https://github.com/ocornut/imgui.git
synced 2026-03-24 17:41:01 +00:00
ImDrawList: Fixed AddConvexPolyFilled() undefined behavior when passing points_count smaller than 3, in particular, points_count==0 could lead to a memory stomp if the draw list was previously empty.
This commit is contained in:
@@ -822,6 +822,9 @@ void ImDrawList::AddPolyline(const ImVec2* points, const int points_count, ImU32
|
||||
|
||||
void ImDrawList::AddConvexPolyFilled(const ImVec2* points, const int points_count, ImU32 col)
|
||||
{
|
||||
if (points_count < 3)
|
||||
return;
|
||||
|
||||
const ImVec2 uv = _Data->TexUvWhitePixel;
|
||||
|
||||
if (Flags & ImDrawListFlags_AntiAliasedFill)
|
||||
|
||||
Reference in New Issue
Block a user