Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenoit Bolsee <benoit.bolsee@online.be>2012-06-07 12:16:41 +0400
committerBenoit Bolsee <benoit.bolsee@online.be>2012-06-07 12:16:41 +0400
commit2b889eea8d1e43e46c9a1dfb2ab3a253eab60e55 (patch)
tree020c97f7c11fa09938a29812215e05194ed7fa03 /source/blender/ikplugin
parentef850d75f52726e9d479cd9873ec8b6343cdf3f2 (diff)
Fix [#31430] part 2: crash in iTaSC when end effector is a fixed bone. This situation was causing access to invalid index in the joint angle array although the end effector doesn't need any joint angle to compute its pause. Fixed this by changing the internal API of joint array: return pointer instead of reference so that NULL pointer can be returned instead of crashing when the index is invalid.
Diffstat (limited to 'source/blender/ikplugin')
-rw-r--r--source/blender/ikplugin/intern/itasc_plugin.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/source/blender/ikplugin/intern/itasc_plugin.cpp b/source/blender/ikplugin/intern/itasc_plugin.cpp
index ebbb201de8e..048dd955726 100644
--- a/source/blender/ikplugin/intern/itasc_plugin.cpp
+++ b/source/blender/ikplugin/intern/itasc_plugin.cpp
@@ -1000,7 +1000,7 @@ static void convert_pose(IK_Scene *ikscene)
// assume uniform scaling and take Y scale as general scale for the armature
scale = len_v3(ikscene->blArmature->obmat[1]);
- rot = (ikscene->jointArray.rows() > 0) ? &ikscene->jointArray(0) : NULL;
+ rot = ikscene->jointArray(0);
for (joint=a=0, ikchan = ikscene->channels; a<ikscene->numchan && joint<ikscene->numjoint; ++a, ++ikchan) {
pchan= ikchan->pchan;
bone= pchan->bone;
@@ -1041,7 +1041,7 @@ static void BKE_pose_rest(IK_Scene *ikscene)
// rest pose is 0
SetToZero(ikscene->jointArray);
// except for transY joints
- rot = (ikscene->jointArray.rows() > 0) ? &ikscene->jointArray(0) : NULL;
+ rot = ikscene->jointArray(0);
for (joint=a=0, ikchan = ikscene->channels; a<ikscene->numchan && joint<ikscene->numjoint; ++a, ++ikchan) {
pchan= ikchan->pchan;
bone= pchan->bone;
@@ -1140,7 +1140,7 @@ static IK_Scene* convert_tree(Scene *blscene, Object *ob, bPoseChannel *pchan)
// in Blender, the rest pose is always 0 for joints
BKE_pose_rest(ikscene);
}
- rot = (ikscene->jointArray.rows() > 0) ? &ikscene->jointArray(0) : NULL;
+ rot = ikscene->jointArray(0);
for (a=0, ikchan = ikscene->channels; a<tree->totchannel; ++a, ++ikchan) {
pchan= ikchan->pchan;
bone= pchan->bone;