vcomp/cmpto_j2k.cpp - Update val comparison to DBL_MAX

`unit_evaluate_dbl()` returns a double and in certain cases, the returned val may exceed UINT_MAX, causing an unexpected error.
This commit is contained in:
ATrivialAtomic
2025-11-14 11:00:47 -05:00
parent 7cc5726470
commit df49a6fc65

View File

@@ -52,6 +52,7 @@
#endif // HAVE_CONFIG_H
#include <cassert>
#include <cfloat>
#include <cmath>
#include <climits>
#include <condition_variable>
@@ -733,7 +734,7 @@ static void usage(bool full) {
#define ASSIGN_CHECK_VAL(var, str, minval) \
do { \
const double val = unit_evaluate_dbl(str, false, nullptr); \
if (std::isnan(val) || val < (minval) || val > UINT_MAX) { \
if (std::isnan(val) || val < (minval) || val > DBL_MAX) { \
LOG(LOG_LEVEL_ERROR) \
<< "[J2K] Wrong value " << (str) \
<< " for " #var "! Value must be >= " << (minval) \