diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-07-17 17:28:30 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-07-17 17:28:30 +0400 |
commit | 9c714f695ae3156519b6e8f4abd0d82f171ba541 (patch) | |
tree | a03b6625ce3598d4859252a0050ec1ad50db5a40 /source/blender/blenkernel | |
parent | 6f0950a1f4abd884234c4e5f980e21ef3915eaff (diff) |
fix for particle system using uninitialized stack memory with midpoint of rk4 integrators.
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r-- | source/blender/blenkernel/intern/particle_system.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/source/blender/blenkernel/intern/particle_system.c b/source/blender/blenkernel/intern/particle_system.c index 457903a4d09..0b3131f0a1c 100644 --- a/source/blender/blenkernel/intern/particle_system.c +++ b/source/blender/blenkernel/intern/particle_system.c @@ -2159,7 +2159,9 @@ static void integrate_particle(ParticleSettings *part, ParticleData *pa, float d break; } - copy_particle_key(states, &pa->state, 1); + for (i=0; i<steps; i++) { + copy_particle_key(states + i, &pa->state, 1); + } states->time = 0.f; @@ -2739,7 +2741,12 @@ static void basic_rotate(ParticleSettings *part, ParticleData *pa, float dfra, f return; } - extrotfac = len_v3(pa->state.ave); + if (part->flag & PART_ROT_DYN) { + extrotfac = len_v3(pa->state.ave); + } + else { + extrotfac = 0.0f; + } if ((part->flag & PART_ROT_DYN) && ELEM3(part->avemode, PART_AVE_VELOCITY, PART_AVE_HORIZONTAL, PART_AVE_VERTICAL)) { float angle; |