summaryrefslogtreecommitdiff
path: root/servers/physics_3d
diff options
context:
space:
mode:
authorMariano Javier Suligoy <marianognu.easyrpg@gmail.com>2022-11-02 16:16:18 -0300
committerMariano Javier Suligoy <marianognu.easyrpg@gmail.com>2022-11-02 16:16:18 -0300
commita39ac1383b1ee2f837ff07c9dfe207c481c62e5b (patch)
tree03b2c8db316ccaf154bd7afc6092f1f12f3f0ae4 /servers/physics_3d
parenteddaab17eaffeef3ad38612bf72a901fd0ffcde5 (diff)
Avoid memory corruption when GodotConvexPolygonShape3D is setup more than once
Diffstat (limited to 'servers/physics_3d')
-rw-r--r--servers/physics_3d/godot_shape_3d.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/servers/physics_3d/godot_shape_3d.cpp b/servers/physics_3d/godot_shape_3d.cpp
index 1443cd166b..3a40d302df 100644
--- a/servers/physics_3d/godot_shape_3d.cpp
+++ b/servers/physics_3d/godot_shape_3d.cpp
@@ -1085,6 +1085,8 @@ void GodotConvexPolygonShape3D::_setup(const Vector<Vector3> &p_vertices) {
if (err != OK) {
ERR_PRINT("Failed to build convex hull");
}
+ extreme_vertices.resize(0);
+ vertex_neighbors.resize(0);
AABB _aabb;