diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-10-07 14:01:54 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-10-07 14:01:54 +0400 |
commit | 35f0ded3776bc08fb52e8068a8a91374192d5b2f (patch) | |
tree | c3f87280e57ff704467924fc4e6ea55ae645e8ae /source/blender | |
parent | e8872a8ea259c856aab188cda8eb4502d6a02cfc (diff) |
fix for logical errors
- range check on hair_velocity_smoothing() was off by one.
- cloth sim parm's are used before NULL check in readfile.c
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/blenkernel/intern/implicit.c | 2 | ||||
-rw-r--r-- | source/blender/blenloader/intern/readfile.c | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/source/blender/blenkernel/intern/implicit.c b/source/blender/blenkernel/intern/implicit.c index ebb95a6561e..2b23e8450ae 100644 --- a/source/blender/blenkernel/intern/implicit.c +++ b/source/blender/blenkernel/intern/implicit.c @@ -1450,7 +1450,7 @@ static void hair_velocity_smoothing(ClothModifierData *clmd, lfVector *lF, lfVec i = HAIR_GRID_INDEX(lX[v], gmin, gmax, 0); j = HAIR_GRID_INDEX(lX[v], gmin, gmax, 1); k = HAIR_GRID_INDEX(lX[v], gmin, gmax, 2); - if (i < 0 || j < 0 || k < 0 || i > 10 || j >= 10 || k >= 10) + if (i < 0 || j < 0 || k < 0 || i >= 10 || j >= 10 || k >= 10) continue; grid[i][j][k].velocity[0] += lV[v][0]; diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 26d9fb9e829..fdb68d4cc17 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -3567,10 +3567,10 @@ static void direct_link_particlesystems(FileData *fd, ListBase *particles) psys->clmd->clothObject = NULL; psys->clmd->sim_parms= newdataadr(fd, psys->clmd->sim_parms); - psys->clmd->sim_parms->effector_weights = NULL; psys->clmd->coll_parms= newdataadr(fd, psys->clmd->coll_parms); if (psys->clmd->sim_parms) { + psys->clmd->sim_parms->effector_weights = NULL; if (psys->clmd->sim_parms->presets > 10) psys->clmd->sim_parms->presets = 0; } |