From fd90fc2c9b2d5b2520894ccc69db1fa39cbe43f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Delf=20Neum=C3=A4rker?= Date: Thu, 18 Feb 2021 22:43:39 +0100 Subject: [PATCH] Fix handling of negative indices in SurfaceTool (cherry picked from commit 735f75a16bdca48d78469fd0a04e383bf268344b) --- scene/resources/surface_tool.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/scene/resources/surface_tool.cpp b/scene/resources/surface_tool.cpp index ed0485d661d..a8c4a74e7c6 100644 --- a/scene/resources/surface_tool.cpp +++ b/scene/resources/surface_tool.cpp @@ -266,6 +266,7 @@ void SurfaceTool::add_triangle_fan(const Vector &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);