mirror of
https://github.com/ocornut/imgui.git
synced 2024-11-23 21:09:01 +08:00
ImDrawList: Fixed OOB access in _CalcCircleAutoSegmentCount when passing excessively large radius to AddCircle(). (#6657, #5317)
This commit is contained in:
parent
f8c768760b
commit
52587c28d6
@ -46,6 +46,8 @@ Other changes:
|
||||
|
||||
- Sliders: Fixed an integer overflow and div-by-zero in SliderInt() when
|
||||
v_max=INT_MAX (#6675, #6679) [@jbarthelmes]
|
||||
- ImDrawList: Fixed OOB access in _CalcCircleAutoSegmentCount when passing excessively
|
||||
large radius to AddCircle(). (#6657, #5317) [@EggsyCRO, @jdpatdiscord]
|
||||
|
||||
|
||||
-----------------------------------------------------------------------
|
||||
|
@ -561,7 +561,7 @@ int ImDrawList::_CalcCircleAutoSegmentCount(float radius) const
|
||||
{
|
||||
// Automatic segment count
|
||||
const int radius_idx = (int)(radius + 0.999999f); // ceil to never reduce accuracy
|
||||
if (radius_idx < IM_ARRAYSIZE(_Data->CircleSegmentCounts))
|
||||
if (radius_idx >= 0 && radius_idx < IM_ARRAYSIZE(_Data->CircleSegmentCounts))
|
||||
return _Data->CircleSegmentCounts[radius_idx]; // Use cached value
|
||||
else
|
||||
return IM_DRAWLIST_CIRCLE_AUTO_SEGMENT_CALC(radius, _Data->CircleSegmentMaxError);
|
||||
|
Loading…
Reference in New Issue
Block a user