From ae08a0ff5b0628485c0608d4f8a56db2ea047951 Mon Sep 17 00:00:00 2001 From: Ansariel Date: Tue, 26 Aug 2014 09:58:46 +0200 Subject: [PATCH] Another stab at FIRE-13407: Skinned simple shader compilation - index out of bounds --- indra/newview/llvovolume.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index 024fa403de..e435d16b40 100755 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -4087,7 +4087,10 @@ void LLRiggedVolume::update(const LLMeshSkinInfo* skin, LLVOAvatar* avatar, cons { F32 w = weight[j][k]; - idx[k] = (S32) floorf(w); + // Proper matrix array length for fitted mesh + //idx[k] = (S32) floorf(w); + idx[k] = llclamp((S32) floorf(w), 0, (S32)kMaxJoints - 1); + // wght[k] = w - floorf(w); scale += wght[k]; }