Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJanne Karhu <jhkarh@gmail.com>2010-10-14 13:01:03 +0400
committerJanne Karhu <jhkarh@gmail.com>2010-10-14 13:01:03 +0400
commitd3bf6b7224d63420232464381203d51125dd3374 (patch)
treeea6839c96a6a869a59d99d6eab774686e39615ca /source/blender/blenkernel/intern/pointcache.c
parent3d73a37b64774ce246c0151f952b83a6fc78f2ac (diff)
Fix for [#24237] Hair dynamics with zero particles generates a segmentation fault
Diffstat (limited to 'source/blender/blenkernel/intern/pointcache.c')
-rw-r--r--source/blender/blenkernel/intern/pointcache.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/source/blender/blenkernel/intern/pointcache.c b/source/blender/blenkernel/intern/pointcache.c
index a15e66ed843..f9d2c1c3fec 100644
--- a/source/blender/blenkernel/intern/pointcache.c
+++ b/source/blender/blenkernel/intern/pointcache.c
@@ -2993,13 +2993,17 @@ void BKE_ptcache_update_info(PTCacheID *pid)
void BKE_ptcache_validate(PointCache *cache, int framenr)
{
- cache->flag |= PTCACHE_SIMULATION_VALID;
- cache->simframe = framenr;
+ if(cache) {
+ cache->flag |= PTCACHE_SIMULATION_VALID;
+ cache->simframe = framenr;
+ }
}
void BKE_ptcache_invalidate(PointCache *cache)
{
- cache->flag &= ~PTCACHE_SIMULATION_VALID;
- cache->simframe = 0;
- cache->last_exact = MIN2(cache->startframe, 0);
+ if(cache) {
+ cache->flag &= ~PTCACHE_SIMULATION_VALID;
+ cache->simframe = 0;
+ cache->last_exact = MIN2(cache->startframe, 0);
+ }
}