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:
authorLukas Tönne <lukas.toenne@gmail.com>2014-11-20 19:15:16 +0300
committerLukas Tönne <lukas.toenne@gmail.com>2015-01-20 11:30:08 +0300
commitc3c19509b3ecea26b49115cdc9a47f786ac76954 (patch)
tree92be3c69b4878f6880027e011c9e2d6bef678dba /source/blender/modifiers/intern
parent790b9319560b0e974702f1671172a8daf6cd2a03 (diff)
Fix for invalid particle pointer access in mixed particle/child loop.
Diffstat (limited to 'source/blender/modifiers/intern')
-rw-r--r--source/blender/modifiers/intern/MOD_particleinstance.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/source/blender/modifiers/intern/MOD_particleinstance.c b/source/blender/modifiers/intern/MOD_particleinstance.c
index fbb2e16a6a7..bf10863c9ab 100644
--- a/source/blender/modifiers/intern/MOD_particleinstance.c
+++ b/source/blender/modifiers/intern/MOD_particleinstance.c
@@ -331,6 +331,12 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob,
float hairmat[4][4];
float mat[3][3];
+ if (first_particle + p < psys->totpart)
+ pa = psys->particles + first_particle + p;
+ else {
+ ChildParticle *cpa = psys->child + p;
+ pa = psys->particles + cpa->parent;
+ }
psys_mat_hair_to_global(sim.ob, sim.psmd->dm, sim.psys->part->from, pa, hairmat);
copy_m3_m4(mat, hairmat);
/* to quaternion */