From 1afec3ca0d86fc2682ce2f7ce5501bd4ec3fc594 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kevin=20M=C3=BCller?= <62548694+CinTheDev@users.noreply.github.com> Date: Mon, 20 May 2024 00:08:14 +0200 Subject: [PATCH] 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. --- src/platform_impl/linux/x11/event_processor.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/platform_impl/linux/x11/event_processor.rs b/src/platform_impl/linux/x11/event_processor.rs index 4eb99cac5..4b233ec69 100644 --- a/src/platform_impl/linux/x11/event_processor.rs +++ b/src/platform_impl/linux/x11/event_processor.rs @@ -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.