Showing the changes to interface/src/avatar/SkeletonModel.cpp (1 of 7 files). Show all
Unified · Split
| @@ -255,9 +255,12 @@ void SkeletonModel::applyPalmData(int jointIndex, PalmData& palm) { · 254 unmodified lines | ||
| 255 | 255 | } |
| 256 | 256 | |
| 257 | 257 | void SkeletonModel::updateJointState(int index) { |
| 258 | + if (index > _jointStates.size()) { | |
| 259 | + return; // bail | |
| 260 | + } | |
| 258 | 261 | JointState& state = _jointStates[index]; |
| 259 | 262 | const FBXJoint& joint = state.getFBXJoint(); |
| 260 | − if (joint.parentIndex != -1) { | |
| 263 | + if (joint.parentIndex != -1 && joint.parentIndex <= _jointStates.size()) { | |
| 261 | 264 | const JointState& parentState = _jointStates.at(joint.parentIndex); |
| 262 | 265 | const FBXGeometry& geometry = _geometry->getFBXGeometry(); |
| 263 | 266 | if (index == geometry.leanJointIndex) { |