From 03038df1cc018d80fb0307416fb24de0eaf41a99 Mon Sep 17 00:00:00 2001 From: ocornut Date: Mon, 8 Feb 2021 14:03:24 +0100 Subject: [PATCH] ImDrawList: fix divide by zero (for which result was unused but triggering on some archs/setup) added by f144c67676 (#3738) --- imgui_draw.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/imgui_draw.cpp b/imgui_draw.cpp index 213ac447..c316384e 100644 --- a/imgui_draw.cpp +++ b/imgui_draw.cpp @@ -384,7 +384,7 @@ void ImDrawListSharedData::SetCircleSegmentMaxError(float max_error) for (int i = 0; i < IM_ARRAYSIZE(CircleSegmentCounts); i++) { const float radius = (float)i; - const int segment_count = IM_DRAWLIST_CIRCLE_AUTO_SEGMENT_CALC(radius, CircleSegmentMaxError); + const int segment_count = (i > 0) ? IM_DRAWLIST_CIRCLE_AUTO_SEGMENT_CALC(radius, CircleSegmentMaxError) : 0; CircleSegmentCounts[i] = (ImU8)ImMin(segment_count, 255); } }