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:
authorBrecht Van Lommel <brechtvanlommel@pandora.be>2012-12-03 16:21:44 +0400
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2012-12-03 16:21:44 +0400
commit41f98978e3430a7d38684d49891505bb954375aa (patch)
treea69caf8413332c0d359c7a873d86c77f16d3c4fc /intern/cycles/kernel/svm/svm_ramp.h
parentf00a49baaaf4b2f8d8a6a6265255fa7085a79bf8 (diff)
Fix cycles issue when NaN is used for RGB ramp, can access array out of bounds then.
OSL noise() function is generating NaN's in certain cases, fix for that goes to our OSL branch. Also add missing minimum weight and max closure checks to OSL, forgot to add these when fixing another bug.
Diffstat (limited to 'intern/cycles/kernel/svm/svm_ramp.h')
-rw-r--r--intern/cycles/kernel/svm/svm_ramp.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/intern/cycles/kernel/svm/svm_ramp.h b/intern/cycles/kernel/svm/svm_ramp.h
index 55c2b3f6af4..c64413cbe84 100644
--- a/intern/cycles/kernel/svm/svm_ramp.h
+++ b/intern/cycles/kernel/svm/svm_ramp.h
@@ -25,7 +25,8 @@ __device float4 rgb_ramp_lookup(KernelGlobals *kg, int offset, float f)
{
f = clamp(f, 0.0f, 1.0f)*(RAMP_TABLE_SIZE-1);
- int i = (int)f;
+ /* clamp int as well in case of NaN */
+ int i = clamp((int)f, 0, RAMP_TABLE_SIZE-1);
float t = f - (float)i;
float4 a = fetch_node_float(kg, offset+i);