mirror of
https://github.com/outbackdingo/UltraGrid.git
synced 2026-03-22 08:40:28 +00:00
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:
@@ -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) \
|
||||
|
||||
Reference in New Issue
Block a user