[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [12918] trunk/blender/source/blender/ blenkernel/intern/particle.c: Bugfix #7918: Particles (svn) Crashing when adding particles in EditMode

Joshua Leung aligorith at gmail.com
Mon Dec 17 07:32:53 CET 2007


Revision: 12918
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=12918
Author:   aligorith
Date:     2007-12-17 07:32:53 +0100 (Mon, 17 Dec 2007)

Log Message:
-----------
Bugfix #7918: Particles (svn) Crashing when adding particles in EditMode

This commit should fix the error. dm was used before being check if it was NULL.

Modified Paths:
--------------
    trunk/blender/source/blender/blenkernel/intern/particle.c

Modified: trunk/blender/source/blender/blenkernel/intern/particle.c
===================================================================
--- trunk/blender/source/blender/blenkernel/intern/particle.c	2007-12-17 06:24:10 UTC (rev 12917)
+++ trunk/blender/source/blender/blenkernel/intern/particle.c	2007-12-17 06:32:53 UTC (rev 12918)
@@ -691,12 +691,13 @@
 #define PARTICLE_ERROR(_nor, _vec) _vec[0]=_vec[1]=_vec[2]=0.0; if(_nor){ _nor[0]=_nor[1]=0.0; _nor[2]=1.0; }
 void psys_particle_on_dm(Object *ob, DerivedMesh *dm, int from, int index, int index_dmcache, float *fw, float foffset, float *vec, float *nor, float *utan, float *vtan, float *orco, float *ornor)
 {
-	float (*orcodata)[3] = dm->getVertDataArray(dm, CD_ORCO);
+	float (*orcodata)[3];
 
 	if(index < 0){ /* 'no dm' error has happened! */
 		PARTICLE_ERROR(nor, vec);
 		return;
 	}
+	orcodata= dm->getVertDataArray(dm, CD_ORCO);
 
 	if (dm->deformedOnly || index_dmcache == DMCACHE_ISCHILD) {
 		/* this works for meshes with deform verts only - constructive modifiers wont work properly*/





More information about the Bf-blender-cvs mailing list