diff options
author | Campbell Barton <ideasman42@gmail.com> | 2014-03-11 16:04:59 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2014-03-11 16:04:59 +0400 |
commit | 500088d9e34439a936d8060e4b0026508d046879 (patch) | |
tree | 687cfc8bea3456788cb28bbdc2c7b63f3d2f0aaa /source | |
parent | ced595a37d373e9a27f2ac0ed24f975dfdab4818 (diff) |
Fix T39078: crash increasing hair emission number
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/blenkernel/intern/particle.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/particle.c b/source/blender/blenkernel/intern/particle.c index 10889763638..3a6e710d68c 100644 --- a/source/blender/blenkernel/intern/particle.c +++ b/source/blender/blenkernel/intern/particle.c @@ -2397,6 +2397,11 @@ void psys_find_parents(ParticleSimulationData *sim) if ((sim->psys->renderdata || G.is_rendering) && part->child_nbr && part->ren_child_nbr) totparent *= (float)part->child_nbr / (float)part->ren_child_nbr; + /* hard limit, workaround for it being ignored above */ + if (sim->psys->totpart < totparent) { + totparent = sim->psys->totpart; + } + tree = BLI_kdtree_new(totparent); for (p = 0, cpa = sim->psys->child; p < totparent; p++, cpa++) { |