glfw: hot patch undefined behavior in GLFW that went unnoticed 6+ years
Upstream pull request: https://github.com/glfw/glfw/pull/1986 Article: https://devlog.hexops.com/2021/perfecting-glfw-for-zig-and-finding-undefined-behavior Fixes hexops/mach#20 Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
This commit is contained in:
parent
93110e82ca
commit
9bc9984930
2 changed files with 33 additions and 34 deletions
|
|
@ -2133,10 +2133,10 @@ void _glfwPlatformSetWindowIcon(_GLFWwindow* window,
|
|||
|
||||
for (j = 0; j < images[i].width * images[i].height; j++)
|
||||
{
|
||||
*target++ = (images[i].pixels[j * 4 + 0] << 16) |
|
||||
(images[i].pixels[j * 4 + 1] << 8) |
|
||||
(images[i].pixels[j * 4 + 2] << 0) |
|
||||
(images[i].pixels[j * 4 + 3] << 24);
|
||||
*target++ = (((long)images[i].pixels[j * 4 + 0]) << 16) |
|
||||
(((long)images[i].pixels[j * 4 + 1]) << 8) |
|
||||
(((long)images[i].pixels[j * 4 + 2]) << 0) |
|
||||
(((long)images[i].pixels[j * 4 + 3]) << 24);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue