[Bf-blender-cvs] [d8b0470] master: Fix T40733: Segfault with hair particles cache and vgroups.

Lukas Tönne noreply at git.blender.org
Sun Jun 29 15:54:06 CEST 2014


Commit: d8b0470fd0f794e7ce6bca14a075fd193cca9d8a
Author: Lukas Tönne
Date:   Sun Jun 29 15:51:58 2014 +0200
https://developer.blender.org/rBd8b0470fd0f794e7ce6bca14a075fd193cca9d8a

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 ...

===================================================================

M	source/blender/blenkernel/intern/particle.c

===================================================================

diff --git a/source/blender/blenkernel/intern/particle.c b/source/blender/blenkernel/intern/particle.c
index e5efffa..50152c7 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);




More information about the Bf-blender-cvs mailing list