Selaa lähdekoodia

ImDrawList: ChannelsSetCurrent() added an extra assert

ocornut 10 vuotta sitten
vanhempi
commit
a5132286b7
1 muutettua tiedostoa jossa 1 lisäystä ja 0 poistoa
  1. 1 0
      imgui_draw.cpp

+ 1 - 0
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));