diff --git a/gdk/wayland/gdkdisplay-wayland.c b/gdk/wayland/gdkdisplay-wayland.c index 70107360fe..be0ca0ed2e 100644 --- a/gdk/wayland/gdkdisplay-wayland.c +++ b/gdk/wayland/gdkdisplay-wayland.c @@ -313,7 +313,9 @@ linux_dmabuf_main_device (void *data, struct zwp_linux_dmabuf_feedback_v1 *zwp_linux_dmabuf_feedback_v1, struct wl_array *device) { - dev_t dev G_GNUC_UNUSED = *(dev_t *)device->data; + dev_t dev G_GNUC_UNUSED; + + memcpy (&dev, device->data, sizeof (dev_t)); GDK_DEBUG (MISC, "got dmabuf main device: %u %u", major (dev), minor (dev)); } @@ -330,7 +332,9 @@ linux_dmabuf_tranche_target_device (void *data, struct zwp_linux_dmabuf_feedback_v1 *zwp_linux_dmabuf_feedback_v1, struct wl_array *device) { - dev_t dev G_GNUC_UNUSED = *(dev_t *)device->data; + dev_t dev G_GNUC_UNUSED; + + memcpy (&dev, device->data, sizeof (dev_t)); GDK_DEBUG (MISC, "got dmabuf tranche target device: %u %u", major (dev), minor (dev)); }