summaryrefslogtreecommitdiff
path: root/indra/newview/llskinningutil.cpp
diff options
context:
space:
mode:
authorJonathan "Geenz" Goodman <geenz@lindenlab.com>2025-08-08 18:32:24 -0400
committerGitHub <noreply@github.com>2025-08-08 18:32:24 -0400
commit28678996ceaea019aafaa26911a440769320c498 (patch)
tree1c5461d5b432b2b6114faee0ebfb1bb2d2f5095a /indra/newview/llskinningutil.cpp
parenta6feb3dc7f3b1985bcc6a16330b368917cff25f8 (diff)
parentf338b91f7c9dbfe999b5ea9a1facb9eaeafb3407 (diff)
Merge pull request #4382 from secondlife/release/2025.05
Release/2025.05
Diffstat (limited to 'indra/newview/llskinningutil.cpp')
-rw-r--r--indra/newview/llskinningutil.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/indra/newview/llskinningutil.cpp b/indra/newview/llskinningutil.cpp
index cee43f3cff..47f58afa00 100644
--- a/indra/newview/llskinningutil.cpp
+++ b/indra/newview/llskinningutil.cpp
@@ -135,6 +135,12 @@ void LLSkinningUtil::initSkinningMatrixPalette(
initJointNums(const_cast<LLMeshSkinInfo*>(skin), avatar);
+ if (skin->mInvBindMatrix.size() < count )
+ {
+ // faulty model? mInvBindMatrix.size() should have matched mJointNames.size()
+ return;
+ }
+
LLMatrix4a world[LL_CHARACTER_MAX_ANIMATED_JOINTS];
for (S32 j = 0; j < count; ++j)
@@ -354,7 +360,8 @@ void LLSkinningUtil::updateRiggingInfo(const LLMeshSkinInfo* skin, LLVOAvatar *a
{
rig_info_tab[joint_num].setIsRiggedTo(true);
- const LLMatrix4a& mat = skin->mBindPoseMatrix[joint_index];
+ size_t bind_poses_size = skin->mBindPoseMatrix.size();
+ const LLMatrix4a& mat = bind_poses_size > joint_index ? skin->mBindPoseMatrix[joint_index] : LLMatrix4a::identity();
LLVector4a pos_joint_space;
mat.affineTransform(pos, pos_joint_space);