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:
authorCampbell Barton <ideasman42@gmail.com>2012-07-17 17:28:30 +0400
committerCampbell Barton <ideasman42@gmail.com>2012-07-17 17:28:30 +0400
commit9c714f695ae3156519b6e8f4abd0d82f171ba541 (patch)
treea03b6625ce3598d4859252a0050ec1ad50db5a40 /source/blender/blenkernel/intern/particle_system.c
parent6f0950a1f4abd884234c4e5f980e21ef3915eaff (diff)
fix for particle system using uninitialized stack memory with midpoint of rk4 integrators.
Diffstat (limited to 'source/blender/blenkernel/intern/particle_system.c')
-rw-r--r--source/blender/blenkernel/intern/particle_system.c11
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;