emoon / rust_minifb

Cross platfrom window and framebuffer crate for Rust
MIT License
1.04k stars 99 forks source link

Fix incorrect deferencing of Windows window handles #367

Closed Wumpf closed 1 month ago

Wumpf commented 1 month ago

Windows handles are pointers by type, but dereferencing these doesn't have any meaning and naturally may just crash (it does ;-)) - if you're lucky this is caught by Rust debug checks complaining about alignment, if you're not it's just a segfault.

Tested this on https://github.com/Wumpf/minifb_wgpu_web_and_desktop (at https://github.com/Wumpf/minifb_wgpu_web_and_desktop/commit/e39be06686b9b8662d27fd4cb0a3787dfaee172d)

emoon commented 1 month ago

Great! Thanks :)