diff options
author | A. Wilcox <awilcox@wilcox-tech.com> | 2020-07-08 19:36:37 +0000 |
---|---|---|
committer | A. Wilcox <awilcox@wilcox-tech.com> | 2020-07-08 19:36:37 +0000 |
commit | b4312fbe4619ff27c5dbffea9efdcf28fbe6ac13 (patch) | |
tree | 20ea7e718399b179330f2966c742da72d00cff96 /user/sane/BTS-304.patch | |
parent | 3db1645ab4a0a4f219f23f84cb2cc4d073b34e1b (diff) | |
parent | 3580df673d9dd6cb26e1e1cd38017029ca7ace79 (diff) | |
download | packages-b4312fbe4619ff27c5dbffea9efdcf28fbe6ac13.tar.gz packages-b4312fbe4619ff27c5dbffea9efdcf28fbe6ac13.tar.bz2 packages-b4312fbe4619ff27c5dbffea9efdcf28fbe6ac13.tar.xz packages-b4312fbe4619ff27c5dbffea9efdcf28fbe6ac13.zip |
Merge branch 'sec/sane' into 'master'
user/sane: [CVE] bump to 1.0.30 (#294)
See merge request adelie/packages!463
Diffstat (limited to 'user/sane/BTS-304.patch')
-rw-r--r-- | user/sane/BTS-304.patch | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/user/sane/BTS-304.patch b/user/sane/BTS-304.patch new file mode 100644 index 000000000..64b7dca02 --- /dev/null +++ b/user/sane/BTS-304.patch @@ -0,0 +1,30 @@ +diff --git a/backend/genesys/image_pixel.cpp b/backend/genesys/image_pixel.cpp +index 1b83e127d..1ebba7fe0 100644 +--- a/backend/genesys/image_pixel.cpp ++++ b/backend/genesys/image_pixel.cpp +@@ -46,6 +46,7 @@ + #include "image.h" + + #include <array> ++#include <cmath> + + namespace genesys { + +@@ -207,7 +208,7 @@ void set_pixel_to_row(std::uint8_t* data, std::size_t x, Pixel pixel, PixelForma + float val = (pixel.r >> 8) * 0.3f; + val += (pixel.g >> 8) * 0.59f; + val += (pixel.b >> 8) * 0.11f; +- data[x] = static_cast<std::uint16_t>(val); ++ data[x] = static_cast<std::uint16_t>(roundf(val)); + return; + } + case PixelFormat::I16: { +@@ -215,7 +216,7 @@ void set_pixel_to_row(std::uint8_t* data, std::size_t x, Pixel pixel, PixelForma + float val = pixel.r * 0.3f; + val += pixel.g * 0.59f; + val += pixel.b * 0.11f; +- auto val16 = static_cast<std::uint16_t>(val); ++ auto val16 = static_cast<std::uint16_t>(roundf(val)); + data[x] = val16 & 0xff; + data[x + 1] = (val16 >> 8) & 0xff; + return; |