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:
authorCampbell Barton <ideasman42@gmail.com>2014-03-11 16:04:59 +0400
committerCampbell Barton <ideasman42@gmail.com>2014-03-11 16:04:59 +0400
commit500088d9e34439a936d8060e4b0026508d046879 (patch)
tree687cfc8bea3456788cb28bbdc2c7b63f3d2f0aaa /source/blender
parentced595a37d373e9a27f2ac0ed24f975dfdab4818 (diff)
Fix T39078: crash increasing hair emission number
Diffstat (limited to 'source/blender')
-rw-r--r--source/blender/blenkernel/intern/particle.c5
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++) {