[v3,05/21] ipa: libipa: awb_bayes: Fix initial max value
diff mbox series

Message ID 20260918120949.191668-6-barnabas.pocze@ideasonboard.com
State New
Headers show
Series
  • libcamera: rcar-gen4 + rpp-x1
Related show

Commit Message

Barnabás Pőcze Sept. 18, 2026, 12:09 p.m. UTC
For floating-point types `std::numeric_limits<T>::min()` is the smallest
normal positive value. So `lowest()` needs to be used other e.g. a value
of 0 will not be properly handled.

This type is only used for logging, so no effects on the algorithm.

Fixes: c2059585f3c7 ("libipa: awb_bayes: Add logging of value limits")
Signed-off-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>
---
 src/ipa/libipa/awb_bayes.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch
diff mbox series

diff --git a/src/ipa/libipa/awb_bayes.cpp b/src/ipa/libipa/awb_bayes.cpp
index 10e05962b8..7f3237c0ab 100644
--- a/src/ipa/libipa/awb_bayes.cpp
+++ b/src/ipa/libipa/awb_bayes.cpp
@@ -66,7 +66,7 @@  class LimitsRecorder
 public:
 	LimitsRecorder()
 		: min_(std::numeric_limits<T>::max()),
-		  max_(std::numeric_limits<T>::min())
+		  max_(std::numeric_limits<T>::lowest())
 	{
 	}