diff options
author | Haoyu Qiu <timothyqiu32@gmail.com> | 2021-10-04 16:12:52 +0800 |
---|---|---|
committer | Haoyu Qiu <timothyqiu32@gmail.com> | 2021-10-04 16:42:53 +0800 |
commit | f3816898fad9a96becf622f8ac4839b6bfe3e1c2 (patch) | |
tree | 400c5541a706feff99e4eac3d460871744e32e78 /servers | |
parent | 66ab3ce954a94fd43baed1dd74381dd32c893407 (diff) |
Fix crash when pinned SoftBody point is out of range
Diffstat (limited to 'servers')
-rw-r--r-- | servers/physics_3d/soft_body_3d_sw.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/servers/physics_3d/soft_body_3d_sw.cpp b/servers/physics_3d/soft_body_3d_sw.cpp index 5e8f8692ba..7d173f9294 100644 --- a/servers/physics_3d/soft_body_3d_sw.cpp +++ b/servers/physics_3d/soft_body_3d_sw.cpp @@ -567,7 +567,7 @@ bool SoftBody3DSW::create_from_trimesh(const Vector<int> &p_indices, const Vecto for (uint32_t i = 0; i < pinned_count; ++i) { int pinned_vertex = pinned_vertices[i]; - ERR_CONTINUE(pinned_vertex >= visual_vertex_count); + ERR_CONTINUE(pinned_vertex < 0 || pinned_vertex >= visual_vertex_count); uint32_t node_index = map_visual_to_physics[pinned_vertex]; ERR_CONTINUE(node_index >= node_count); |