ImDrawList: fixed AddCircle, AddCircleFilled buffer read overflow with (rad > 0.0f && rad < 1.0f && num_segments == 0). (#3738)

Amend 051ce076. Maximum cached count becomes 63 instead of 64.
This commit is contained in:
ocornut
2021-01-25 14:58:52 +01:00
parent 58075c4414
commit f144c67676
5 changed files with 19 additions and 6 deletions

View File

@ -1130,7 +1130,7 @@ void ImGuiIO::ClearInputCharacters()
ImVec2 ImBezierCubicClosestPoint(const ImVec2& p1, const ImVec2& p2, const ImVec2& p3, const ImVec2& p4, const ImVec2& p, int num_segments)
{
IM_ASSERT(num_segments > 0); // Use ImBezierClosestPointCasteljau()
IM_ASSERT(num_segments > 0); // Use ImBezierCubicClosestPointCasteljau()
ImVec2 p_last = p1;
ImVec2 p_closest;
float p_closest_dist2 = FLT_MAX;