From 03d245d818f49ab0ff7e468aba5e64fcdae3e476 Mon Sep 17 00:00:00 2001 From: Bram Stolk Date: Mon, 30 Sep 2024 00:57:23 -0700 Subject: [PATCH] [Math] Fix Nan from powf() domain error. This change prevents calling powf(x,y) with negative x. The SIMD versions using ssePower() already seem to be resistent to negative pixel values, but the scalar version was not. This would cause a SIGFPE on apps that have floating point exceptions enabled. FIXES: #2066 Signed-off-by: Bram Stolk --- src/OpenColorIO/ops/gamma/GammaOpCPU.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/OpenColorIO/ops/gamma/GammaOpCPU.cpp b/src/OpenColorIO/ops/gamma/GammaOpCPU.cpp index ace0006ca8..3ebfd67e34 100644 --- a/src/OpenColorIO/ops/gamma/GammaOpCPU.cpp +++ b/src/OpenColorIO/ops/gamma/GammaOpCPU.cpp @@ -538,7 +538,10 @@ void GammaMoncurveOpCPUFwd::apply(const void * inImg, void * outImg, long numPix for(long idx=0; idx