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>2008-05-22 18:56:32 +0400
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2008-05-22 18:56:32 +0400
commit5463828bd2f62b10640e91637942b8784a7eee5c (patch)
treee770b7b55da9075d106bcf7011ce8a21f798e136 /source/blender/nodes
parent99a2e7e92e9dc84edd2ccd7abbb0dc9d922d0530 (diff)
Fix for part of bug #12075: gamma node generated nan's on negative input.
Diffstat (limited to 'source/blender/nodes')
-rw-r--r--source/blender/nodes/intern/CMP_nodes/CMP_gamma.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/source/blender/nodes/intern/CMP_nodes/CMP_gamma.c b/source/blender/nodes/intern/CMP_nodes/CMP_gamma.c
index 6cd1c5981a6..ff9e2b716ce 100644
--- a/source/blender/nodes/intern/CMP_nodes/CMP_gamma.c
+++ b/source/blender/nodes/intern/CMP_nodes/CMP_gamma.c
@@ -46,7 +46,8 @@ static void do_gamma(bNode *node, float *out, float *in, float *fac)
{
int i=0;
for(i=0; i<3; i++) {
- out[i] = pow(in[i],fac[0]);
+ /* check for negative to avoid nan's */
+ out[i] = (in[0] > 0.0f)? pow(in[i],fac[0]): in[0];
}
out[3] = in[3];
}