forked from pool/nodejs-electron
- New upstream release 21.2.1 * Fixed spurious promise rejection in webContents.loadURL when navigating to a hash. * Updated Chromium to 106.0.5249.165. - Add electron-version-from-env.patch to fix build error - Add upstreamable patches fixing various erroneous C++ constructs * ipcz-safe_math-Wuninitialized.patch * passwords_counter-Wsubobject-linkage.patch * static_constructors-Wstrict-aliasing.patch * vector_math_impl-Wstrict-aliasing.patch * webgl_image_conversion-Wstrict-aliasing.patch * xr_cube_map-Wstrict-aliasing.patch OBS-URL: https://build.opensuse.org/request/show/1032854 OBS-URL: https://build.opensuse.org/package/show/devel:languages:nodejs/nodejs-electron?expand=0&rev=45
32 lines
1.1 KiB
Diff
32 lines
1.1 KiB
Diff
--- src/third_party/blink/renderer/platform/graphics/gpu/webgl_image_conversion.cc.old 2022-10-20 19:00:30.113415900 +0200
|
|
+++ src/third_party/blink/renderer/platform/graphics/gpu/webgl_image_conversion.cc 2022-10-29 22:19:57.652611900 +0200
|
|
@@ -4,6 +4,7 @@
|
|
|
|
#include "third_party/blink/renderer/platform/graphics/gpu/webgl_image_conversion.h"
|
|
|
|
+#include <cstring>
|
|
#include <limits>
|
|
#include <memory>
|
|
|
|
@@ -416,7 +417,8 @@
|
|
24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 13};
|
|
|
|
uint16_t ConvertFloatToHalfFloat(float f) {
|
|
- unsigned temp = *(reinterpret_cast<unsigned*>(&f));
|
|
+ unsigned temp;
|
|
+ std::memcpy(&temp, &f, 4);
|
|
uint16_t signexp = (temp >> 23) & 0x1ff;
|
|
return g_base_table[signexp] +
|
|
((temp & 0x007fffff) >> g_shift_table[signexp]);
|
|
@@ -834,7 +836,9 @@
|
|
uint32_t temp =
|
|
g_mantissa_table[g_offset_table[half >> 10] + (half & 0x3ff)] +
|
|
g_exponent_table[half >> 10];
|
|
- return *(reinterpret_cast<float*>(&temp));
|
|
+ float ret;
|
|
+ std::memcpy(&ret, &temp, 4);
|
|
+ return ret;
|
|
}
|
|
|
|
/* BEGIN CODE SHARED WITH MOZILLA FIREFOX */
|