From e3f7c33767f21c1a517cb1a6ce65d0ac615d0273 Mon Sep 17 00:00:00 2001 From: Atlante45 Date: Fri, 17 Jul 2015 15:39:25 -0700 Subject: [PATCH] Fix index check in setJointRotation --- interface/src/avatar/SkeletonModel.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/interface/src/avatar/SkeletonModel.cpp b/interface/src/avatar/SkeletonModel.cpp index 0a981706da..85e0a3d1f8 100644 --- a/interface/src/avatar/SkeletonModel.cpp +++ b/interface/src/avatar/SkeletonModel.cpp @@ -270,12 +270,12 @@ void SkeletonModel::applyPalmData(int jointIndex, PalmData& palm) { } void SkeletonModel::updateJointState(int index) { - if (index > _jointStates.size()) { + if (index < 0 && index >= _jointStates.size()) { return; // bail } JointState& state = _jointStates[index]; const FBXJoint& joint = state.getFBXJoint(); - if (joint.parentIndex != -1 && joint.parentIndex <= _jointStates.size()) { + if (joint.parentIndex >= 0 && joint.parentIndex < _jointStates.size()) { const JointState& parentState = _jointStates.at(joint.parentIndex); const FBXGeometry& geometry = _geometry->getFBXGeometry(); if (index == geometry.leanJointIndex) {