瀏覽代碼

Merge pull request #68181 from MarianoGnu/fix-convex-hull-crash

Avoid memory corruption when GodotConvexPolygonShape3D is setup more than once
Rémi Verschelde 2 年之前
父節點
當前提交
4a1913fc17
共有 1 個文件被更改,包括 2 次插入0 次删除
  1. 2 0
      servers/physics_3d/godot_shape_3d.cpp

+ 2 - 0
servers/physics_3d/godot_shape_3d.cpp

@@ -1092,6 +1092,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;