summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDelf Neumärker <delf@nmrkr.de>2021-02-18 22:43:39 +0100
committerDelf Neumärker <delf@nmrkr.de>2021-02-18 22:43:39 +0100
commit735f75a16bdca48d78469fd0a04e383bf268344b (patch)
tree804d79a6e60b5ccc58967f9a7338cf15923d4133
parent32dec4accd54dc33c02cc8becf64f40d26736035 (diff)
Fix handling of negative indices in SurfaceTool
-rw-r--r--scene/resources/surface_tool.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/scene/resources/surface_tool.cpp b/scene/resources/surface_tool.cpp
index 5ce3532d42..47933bd69a 100644
--- a/scene/resources/surface_tool.cpp
+++ b/scene/resources/surface_tool.cpp
@@ -299,6 +299,7 @@ void SurfaceTool::add_triangle_fan(const Vector<Vector3> &p_vertices, const Vect
void SurfaceTool::add_index(int p_index) {
ERR_FAIL_COND(!begun);
+ ERR_FAIL_COND(p_index < 0);
format |= Mesh::ARRAY_FORMAT_INDEX;
index_array.push_back(p_index);