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:
authorSergey Sharybin <sergey.vfx@gmail.com>2015-06-09 15:48:50 +0300
committerSergey Sharybin <sergey.vfx@gmail.com>2015-06-09 15:50:28 +0300
commit23d0af50319a0c658853beaf7e19f7fda302136a (patch)
tree1a94ec23e06eb995ec6fc2da6ebf9f02144d0c3f /source/blender/blenkernel
parentab742d302ef921ca2da16a93c30f02d203247108 (diff)
Particles: Avoid bad memory access when calculating child weight
Not sure it's totally correct solution, but it's better than giving unpredictable results.
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r--source/blender/blenkernel/intern/particle.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/source/blender/blenkernel/intern/particle.c b/source/blender/blenkernel/intern/particle.c
index c22eb16a620..a928ed69b9e 100644
--- a/source/blender/blenkernel/intern/particle.c
+++ b/source/blender/blenkernel/intern/particle.c
@@ -1768,9 +1768,9 @@ static void psys_calc_child_parent_weights(ParticleTask *task, struct ChildParti
}
/* modify weights to create parting */
- if (p_fac > 0.f) {
+ if (p_fac > 0.f && key[0]->segments != -1) {
for (w = 0; w < 4; w++) {
- if (w && weight[w] > 0.f) {
+ if (w && weight[w] > 0.f && key[w]->segments != -1) {
float d;
if (part->flag & PART_CHILD_LONG_HAIR) {
/* For long hair use tip distance/root distance as parting factor instead of root to tip angle. */