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:
Diffstat (limited to 'source/blender/compositor/operations')
-rw-r--r--source/blender/compositor/operations/COM_BrightnessOperation.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/source/blender/compositor/operations/COM_BrightnessOperation.cpp b/source/blender/compositor/operations/COM_BrightnessOperation.cpp
index d0bab5aa4d9..b6c22029899 100644
--- a/source/blender/compositor/operations/COM_BrightnessOperation.cpp
+++ b/source/blender/compositor/operations/COM_BrightnessOperation.cpp
@@ -62,12 +62,13 @@ void BrightnessOperation::executePixelSampled(float output[4],
* Extracted of OpenCV demhist.c
*/
if (contrast > 0) {
- a = 1.0f / (1.0f - delta * 2.0f);
+ a = 1.0f - delta * 2.0f;
+ a = 1.0f / max_ff(a, FLT_EPSILON);
b = a * (brightness - delta);
}
else {
delta *= -1;
- a = 1.0f - delta * 2.0f;
+ a = max_ff(1.0f - delta * 2.0f, 0.0f);
b = a * brightness + delta;
}
if (this->m_use_premultiply) {