Merge pull request #2161 from kevinbackhouse/FixIssue2160

Use std::round() in float_to_integer_helper
This commit is contained in:
Kevin Backhouse
2022-03-20 15:09:53 +00:00
committed by GitHub
3 changed files with 3 additions and 1 deletions
+2 -1
View File
@@ -13,6 +13,7 @@
#include <cstring>
#include <iomanip>
#include <map>
#include <cmath>
// *****************************************************************************
// namespace extensions
@@ -1251,7 +1252,7 @@ class ValueType : public Value {
const auto v = value_.at(n);
if (static_cast<decltype(v)>(std::numeric_limits<I>::min()) <= v &&
v <= static_cast<decltype(v)>(std::numeric_limits<I>::max())) {
return static_cast<I>(v);
return static_cast<I>(std::round(v));
} else {
return 0;
}
Binary file not shown.
@@ -88,6 +88,7 @@ def get_valid_files(data_dir):
"issue_857_poc.raf",
"issue_869_poc.png",
"issue_960.poc.webp",
"issue_2160_poc.jpg",
"issue_ghsa_583f_w9pm_99r2_poc.jp2",
"issue_ghsa_7569_phvm_vwc2_poc.jp2",
"pocIssue283.jpg",