Browse Source

don't try to iterate 0 indexes

Jeffery Myers 3 years ago
parent
commit
1fb470eae5
1 changed files with 3 additions and 0 deletions
  1. 3 0
      rlImGui.cpp

+ 3 - 0
rlImGui.cpp

@@ -246,6 +246,9 @@ static void rlImGuiTriangleVert(ImDrawVert& idx_vert)
 
 static void rlImGuiRenderTriangles(unsigned int count, int indexStart, const ImVector<ImDrawIdx>& indexBuffer, const ImVector<ImDrawVert>& vertBuffer, void* texturePtr)
 {
+    if (count == 0)
+        return;
+	
     Texture* texture = (Texture*)texturePtr;
 
     unsigned int textureId = (texture == nullptr) ? 0 : texture->id;