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-06-29 17:51:58 +0400
committerLukas Tönne <lukas.toenne@gmail.com>2014-06-29 17:53:13 +0400
commitd8b0470fd0f794e7ce6bca14a075fd193cca9d8a (patch)
tree9a871499ff7dc5c38c9b47f09012a9bc848f9bf5 /source/blender/blenkernel/intern/particle.c
parentccfe845ff4b7415945b65715c6a64ef0cf933c2f (diff)
Fix T40733: Segfault with hair particles cache and vgroups.
The "fix" is just a stupid index sanity check to avoid crashing. Underlying issue is not identified and probably never will ...
Diffstat (limited to 'source/blender/blenkernel/intern/particle.c')
-rw-r--r--source/blender/blenkernel/intern/particle.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/particle.c b/source/blender/blenkernel/intern/particle.c
index e5efffa5d0e..50152c7d053 100644
--- a/source/blender/blenkernel/intern/particle.c
+++ b/source/blender/blenkernel/intern/particle.c
@@ -2666,6 +2666,9 @@ static void psys_thread_create_path(ParticleThread *thread, struct ChildParticle
/* get the original coordinates (orco) for texture usage */
cpa_from = part->from;
cpa_num = pa->num;
+ /* XXX hack to avoid messed up particle num and subsequent crash (#40733) */
+ if (cpa_num > ctx->sim.psmd->dm->getNumTessFaces(ctx->sim.psmd->dm))
+ cpa_num = 0;
cpa_fuv = pa->fuv;
psys_particle_on_emitter(ctx->sim.psmd, cpa_from, cpa_num, DMCACHE_ISCHILD, cpa_fuv, pa->foffset, co, ornor, 0, 0, orco, 0);