History

add guards to _jointStates array size

ZappoMan committed 11 years ago

Commit 19c8e521 parent 2d4aee72 files · +5 −3Browse files

Showing the changes to libraries/render-utils/src/Model.cpp (1 of 2 files). Show all

Unified · Split

libraries/render-utils/src/Model.cpp+4−2
@@ -1306,8 +1306,10 @@ void Model::updateJointState(int index) { · 1305 unmodified lines
13061306 glm::mat4 parentTransform = glm::scale(_scale) * glm::translate(_offset) * geometry.offset;
13071307 state.computeTransform(parentTransform);
13081308 } else {
1309− const JointState& parentState = _jointStates.at(parentIndex);
1310− state.computeTransform(parentState.getTransform(), parentState.getTransformChanged());
1309+ if (joint.parentIndex >= 0 && joint.parentIndex < _jointStates.size()) {
1310+ const JointState& parentState = _jointStates.at(parentIndex);
1311+ state.computeTransform(parentState.getTransform(), parentState.getTransformChanged());
1312+ }
13111313 }
13121314 }
13131315

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t