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:
authorJacques Lucke <mail@jlucke.com>2020-02-06 12:25:16 +0300
committerJacques Lucke <mail@jlucke.com>2020-02-06 12:25:16 +0300
commitd7429e76b8ac6a39ea0c917cb53655f12fa74636 (patch)
tree84c4757f752578b01e1c7469b4f3a5864b56dd2f /source/blender/compositor
parent02226ef653e1e871be6004a51f08b74c0c9dd8e4 (diff)
parent10705807fe0672d9d42bee293aab6d73f1deb6b2 (diff)
Merge branch 'blender-v2.82-release'
Diffstat (limited to 'source/blender/compositor')
-rw-r--r--source/blender/compositor/operations/COM_ColorCorrectionOperation.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/source/blender/compositor/operations/COM_ColorCorrectionOperation.cpp b/source/blender/compositor/operations/COM_ColorCorrectionOperation.cpp
index a90a3e234d8..31567398d98 100644
--- a/source/blender/compositor/operations/COM_ColorCorrectionOperation.cpp
+++ b/source/blender/compositor/operations/COM_ColorCorrectionOperation.cpp
@@ -117,9 +117,10 @@ void ColorCorrectionOperation::executePixelSampled(float output[4],
g = 0.5f + ((g - 0.5f) * contrast);
b = 0.5f + ((b - 0.5f) * contrast);
- r = powf(r * gain + lift, invgamma);
- g = powf(g * gain + lift, invgamma);
- b = powf(b * gain + lift, invgamma);
+ /* Check for negative values to avoid nan. */
+ r = (r > 0.0f) ? powf(r * gain + lift, invgamma) : r;
+ g = (g > 0.0f) ? powf(g * gain + lift, invgamma) : g;
+ b = (b > 0.0f) ? powf(b * gain + lift, invgamma) : b;
// mix with mask
r = mvalue * inputImageColor[0] + value * r;