[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [53924] trunk/blender/source/blender/ editors/physics/particle_edit.c: fix for possible null pointer dereference in PE_create_particle_edit

Campbell Barton ideasman42 at gmail.com
Sun Jan 20 15:10:14 CET 2013


Revision: 53924
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=53924
Author:   campbellbarton
Date:     2013-01-20 14:10:10 +0000 (Sun, 20 Jan 2013)
Log Message:
-----------
fix for possible null pointer dereference in PE_create_particle_edit

Modified Paths:
--------------
    trunk/blender/source/blender/editors/physics/particle_edit.c

Modified: trunk/blender/source/blender/editors/physics/particle_edit.c
===================================================================
--- trunk/blender/source/blender/editors/physics/particle_edit.c	2013-01-20 13:46:53 UTC (rev 53923)
+++ trunk/blender/source/blender/editors/physics/particle_edit.c	2013-01-20 14:10:10 UTC (rev 53924)
@@ -4147,8 +4147,8 @@
 /* initialize needed data for bake edit */
 static void PE_create_particle_edit(Scene *scene, Object *ob, PointCache *cache, ParticleSystem *psys)
 {
-	PTCacheEdit *edit= (psys)? psys->edit : cache->edit;
-	ParticleSystemModifierData *psmd= (psys)? psys_get_modifier(ob, psys): NULL;
+	PTCacheEdit *edit;
+	ParticleSystemModifierData *psmd = (psys) ? psys_get_modifier(ob, psys) : NULL;
 	POINT_P; KEY_K;
 	ParticleData *pa = NULL;
 	HairKey *hkey;
@@ -4164,6 +4164,8 @@
 	if (psys == NULL && (cache && cache->mem_cache.first == NULL))
 		return;
 
+	edit = (psys) ? psys->edit : cache->edit;
+
 	if (!edit) {
 		totpoint = psys ? psys->totpart : (int)((PTCacheMem *)cache->mem_cache.first)->totpoint;
 




More information about the Bf-blender-cvs mailing list