vulkan/wsi/wayland: fix unaligned load of dev_t

Fixes the following UBSan error:

    ../src/vulkan/wsi/wsi_common_wayland.c:654:27: runtime error: load of misaligned address 0x6110000666b4 for type 'dev_t' (aka 'unsigned long'), which requires 8 byte alignment

Signed-off-by: Simon Ser <contact@emersion.fr>
Reviewed-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19595>
This commit is contained in:
Simon Ser 2022-11-08 15:26:03 +01:00
parent ad5c9c3fa4
commit 145cb3e349

View file

@ -647,8 +647,7 @@ default_dmabuf_feedback_main_device(void *data,
struct wsi_wl_display *display = data;
assert(device->size == sizeof(dev_t));
dev_t *dev = device->data;
display->main_device = *dev;
memcpy(&display->main_device, device->data, device->size);
}
static void