Ver código fonte

Updated ImGui.

Branimir Karadžić 9 anos atrás
pai
commit
0978755a85
1 arquivos alterados com 2 adições e 1 exclusões
  1. 2 1
      3rdparty/ocornut-imgui/imgui.h

+ 2 - 1
3rdparty/ocornut-imgui/imgui.h

@@ -888,7 +888,8 @@ public:
         if (new_capacity <= Capacity) return;
         if (new_capacity <= Capacity) return;
         T* new_data = (value_type*)ImGui::MemAlloc((size_t)new_capacity * sizeof(value_type));
         T* new_data = (value_type*)ImGui::MemAlloc((size_t)new_capacity * sizeof(value_type));
         memset(&new_data[Size], 0, (size_t)(new_capacity - Size) * sizeof(value_type)); // BK - clear garbage so that 0 initialized ImString works properly.
         memset(&new_data[Size], 0, (size_t)(new_capacity - Size) * sizeof(value_type)); // BK - clear garbage so that 0 initialized ImString works properly.
-        memcpy(new_data, Data, (size_t)Size * sizeof(value_type));
+        if (Data)
+            memcpy(new_data, Data, (size_t)Size * sizeof(value_type));
         ImGui::MemFree(Data);
         ImGui::MemFree(Data);
         Data = new_data;
         Data = new_data;
         Capacity = new_capacity;
         Capacity = new_capacity;