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:
authorNicholas Bishop <nicholasbishop@gmail.com>2012-06-11 15:00:58 +0400
committerNicholas Bishop <nicholasbishop@gmail.com>2012-06-11 15:00:58 +0400
commiteba2f2320cf1e0415897240b82d9ff892ce85ae7 (patch)
treeddee15545079e5c17da33501925649865eac0997 /source/blender/blenkernel/intern/armature.c
parentd214b140522424a6794a0f70b2bd738ec41a7005 (diff)
Fix invalid array index in armature_deform_verts().
Check that the def_nr is non-negative before using as index. Fixes bug [#31700] Crash when opening .blend file on 64bit environment
Diffstat (limited to 'source/blender/blenkernel/intern/armature.c')
-rw-r--r--source/blender/blenkernel/intern/armature.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/source/blender/blenkernel/intern/armature.c b/source/blender/blenkernel/intern/armature.c
index 5ad81db1979..9af1d5f52c4 100644
--- a/source/blender/blenkernel/intern/armature.c
+++ b/source/blender/blenkernel/intern/armature.c
@@ -986,7 +986,7 @@ void armature_deform_verts(Object *armOb, Object *target, DerivedMesh *dm, float
for (j = dvert->totweight; j != 0; j--, dw++) {
const int index = dw->def_nr;
- if (index < defbase_tot && (pchan = defnrToPC[index])) {
+ if (index >= 0 && index < defbase_tot && (pchan = defnrToPC[index])) {
float weight = dw->weight;
Bone *bone = pchan->bone;
pdef_info = pdef_info_array + defnrToPCIndex[index];