From a5132286b7c7763942ae84bfc43ddbedcb4964ae Mon Sep 17 00:00:00 2001 From: ocornut Date: Sun, 11 Oct 2015 17:50:55 +0200 Subject: [PATCH] ImDrawList: ChannelsSetCurrent() added an extra assert --- imgui_draw.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/imgui_draw.cpp b/imgui_draw.cpp index e91ba3909..09fcf0154 100644 --- a/imgui_draw.cpp +++ b/imgui_draw.cpp @@ -291,6 +291,7 @@ void ImDrawList::ChannelsMerge() void ImDrawList::ChannelsSetCurrent(int idx) { + IM_ASSERT(idx < _ChannelsCount); if (_ChannelsCurrent == idx) return; memcpy(&_Channels.Data[_ChannelsCurrent].CmdBuffer, &CmdBuffer, sizeof(CmdBuffer)); // copy 12 bytes, four times memcpy(&_Channels.Data[_ChannelsCurrent].IdxBuffer, &IdxBuffer, sizeof(IdxBuffer));