mirror of
https://github.com/rust-windowing/winit.git
synced 2026-06-27 07:03:15 -04:00
bugfix: Replace pointer dereference with read_unaligned
On Raspberry Pi, using the Rust crate eframe caused the program to crash on mouse movement. The Backtrace lead to this specific line of code, and the exact error was a "misaligned pointer dereference: address must be a multiple of 0x8 but is xxxx" The edit has been tested with the Raspberry Pi, which works now.
This commit is contained in:
committed by
Kirill Chibisov
parent
c4a8e9321d
commit
1afec3ca0d
@@ -1424,7 +1424,7 @@ impl EventProcessor {
|
||||
if !xinput2::XIMaskIsSet(mask, i) {
|
||||
continue;
|
||||
}
|
||||
let x = unsafe { *value };
|
||||
let x = unsafe { value.read_unaligned() };
|
||||
|
||||
// We assume that every XInput2 device with analog axes is a pointing device emitting
|
||||
// relative coordinates.
|
||||
|
||||
Reference in New Issue
Block a user