mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-11-09 10:20:07 +00:00
wayland: Fix an ubsan warning
dev_t requires 8-byte alignment, so we need to use memcpy.
This commit is contained in:
parent
f896dddadc
commit
815df9a76a
@ -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));
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user