summaryrefslogtreecommitdiff
path: root/servers/physics_3d
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2021-09-29 15:58:25 +0200
committerGitHub <noreply@github.com>2021-09-29 15:58:25 +0200
commit5e609d0e8cecedc68d842fd9f1171d74c4584028 (patch)
tree1cb7a4a2cb77048952f1e37d42ec3f8fb3b69b7b /servers/physics_3d
parentc1f59139b40f40907b0507a84ec3515c5cc4794b (diff)
parent9dd0d3f550a0940dd53833666cd082e81aab8eff (diff)
Merge pull request #53211 from timothyqiu/request-ub
Diffstat (limited to 'servers/physics_3d')
-rw-r--r--servers/physics_3d/soft_body_3d_sw.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/servers/physics_3d/soft_body_3d_sw.cpp b/servers/physics_3d/soft_body_3d_sw.cpp
index 5f6e202c73..752d5f3a91 100644
--- a/servers/physics_3d/soft_body_3d_sw.cpp
+++ b/servers/physics_3d/soft_body_3d_sw.cpp
@@ -249,8 +249,10 @@ void SoftBody3DSW::update_area() {
// Node area.
LocalVector<int> counts;
- counts.resize(nodes.size());
- memset(counts.ptr(), 0, counts.size() * sizeof(int));
+ if (nodes.size() > 0) {
+ counts.resize(nodes.size());
+ memset(counts.ptr(), 0, counts.size() * sizeof(int));
+ }
for (i = 0, ni = nodes.size(); i < ni; ++i) {
nodes[i].area = 0.0;