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:
Kevin Müller 2024-05-20 00:08:14 +02:00 committed by GitHub
parent ab33fb8eda
commit 2b1c8cea1b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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.