瀏覽代碼

don't try to iterate 0 indexes

Jeffery Myers 3 年之前
父節點
當前提交
1fb470eae5
共有 1 個文件被更改,包括 3 次插入0 次删除
  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;