diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2023-02-12 14:14:03 +0100 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2023-02-12 14:14:03 +0100 |
commit | 77b415ab6d59e823a67668121853aee2b708fd2a (patch) | |
tree | c347b72aaf75a631db576705d0a554aa62f488bf /scene/resources | |
parent | 3fcd98997257a6b856d70a3cf8846c5ac282f823 (diff) |
Fix SurfaceTool crash with invalid bone/weight count
Fixes #53191.
Diffstat (limited to 'scene/resources')
-rw-r--r-- | scene/resources/surface_tool.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/scene/resources/surface_tool.cpp b/scene/resources/surface_tool.cpp index 16cc1c3370..ccb3ddee45 100644 --- a/scene/resources/surface_tool.cpp +++ b/scene/resources/surface_tool.cpp @@ -648,7 +648,7 @@ Array SurfaceTool::commit_to_arrays() { for (uint32_t idx = 0; idx < vertex_array.size(); idx++) { const Vertex &v = vertex_array[idx]; - if (v.bones.size() > count) { + if (v.bones.size() != count) { ERR_PRINT_ONCE(vformat("Invalid bones size %d vs count %d", v.bones.size(), count)); continue; } @@ -672,7 +672,7 @@ Array SurfaceTool::commit_to_arrays() { for (uint32_t idx = 0; idx < vertex_array.size(); idx++) { const Vertex &v = vertex_array[idx]; - if (v.weights.size() > count) { + if (v.weights.size() != count) { ERR_PRINT_ONCE(vformat("Invalid weight size %d vs count %d", v.weights.size(), count)); continue; } |