[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [34150] trunk/blender/source/blender/ blenkernel/intern/pointcache.c: Fix for [#25526] Inmediate crash when changing amount of particles in a particle system
Janne Karhu
jhkarh at gmail.com
Fri Jan 7 11:38:17 CET 2011
Revision: 34150
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=34150
Author: jhk
Date: 2011-01-07 10:38:17 +0000 (Fri, 07 Jan 2011)
Log Message:
-----------
Fix for [#25526] Inmediate crash when changing amount of particles in a particle system
* Point cache index array doesn't necessarily have all particles if the particles were re-allocated recently.
Modified Paths:
--------------
trunk/blender/source/blender/blenkernel/intern/pointcache.c
Modified: trunk/blender/source/blender/blenkernel/intern/pointcache.c
===================================================================
--- trunk/blender/source/blender/blenkernel/intern/pointcache.c 2011-01-07 10:13:30 UTC (rev 34149)
+++ trunk/blender/source/blender/blenkernel/intern/pointcache.c 2011-01-07 10:38:17 UTC (rev 34150)
@@ -1182,7 +1182,7 @@
int data_types = pm->data_types;
int i, index = pm->index_array ? pm->index_array[point_index] - 1 : point_index;
- if(index < 0) {
+ if(index < 0 || point_index >= MEM_allocN_len(pm->index_array)/sizeof(int)) {
/* Can't give proper location without reallocation, so don't give any location.
* Some points will be cached improperly, but this only happens with simulation
* steps bigger than cache->step, so the cache has to be recalculated anyways
More information about the Bf-blender-cvs
mailing list