diff options
author | Janne Karhu <jhkarh@gmail.com> | 2011-01-07 13:38:17 +0300 |
---|---|---|
committer | Janne Karhu <jhkarh@gmail.com> | 2011-01-07 13:38:17 +0300 |
commit | 841c50b5e240e1bb2412dccbf559684105f4056e (patch) | |
tree | 31c4c015fd43dbad1777a74dabeb0a40e1bed623 /source | |
parent | 96128ee69f00fb4a91155f63608c23a2ee5a45a6 (diff) |
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.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/blenkernel/intern/pointcache.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/source/blender/blenkernel/intern/pointcache.c b/source/blender/blenkernel/intern/pointcache.c index c886c252d61..4d96f0508d1 100644 --- a/source/blender/blenkernel/intern/pointcache.c +++ b/source/blender/blenkernel/intern/pointcache.c @@ -1182,7 +1182,7 @@ int BKE_ptcache_mem_pointers_seek(int point_index, PTCacheMem *pm) 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 |