diff options
author | Campbell Barton <ideasman42@gmail.com> | 2013-05-24 04:30:22 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2013-05-24 04:30:22 +0400 |
commit | ebe86abb462a8b38e467d70ca88d58ad15f07336 (patch) | |
tree | ee486583fbcfc7a0d0c2dc41fc453f99158cfc93 /source | |
parent | 30b961abd8ebf4315111fbab8946c42dc317c747 (diff) |
fix [#35478] Spatial Noise crashes Blender on Render
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/freestyle/intern/system/PseudoNoise.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/source/blender/freestyle/intern/system/PseudoNoise.cpp b/source/blender/freestyle/intern/system/PseudoNoise.cpp index b70564d147c..538460dc1e9 100644 --- a/source/blender/freestyle/intern/system/PseudoNoise.cpp +++ b/source/blender/freestyle/intern/system/PseudoNoise.cpp @@ -46,7 +46,7 @@ void PseudoNoise::init(long seed) real PseudoNoise::linearNoise(real x) { real tmp; - int i = modf(x, &tmp) * NB_VALUE_NOISE; + int i = abs(modf(x, &tmp)) * NB_VALUE_NOISE; real x1 = _values[i], x2 = _values[(i + 1) % NB_VALUE_NOISE]; real t = modf(x * NB_VALUE_NOISE, &tmp); return x1 * (1 - t) + x2 * t; @@ -64,7 +64,7 @@ static real LanczosWindowed(real t) real PseudoNoise::smoothNoise(real x) { real tmp; - int i = modf(x, &tmp) * NB_VALUE_NOISE; + int i = abs(modf(x, &tmp)) * NB_VALUE_NOISE; int h = i - 1; if (h < 0) { h = NB_VALUE_NOISE + h; |