From 916e677e7b82e569312b1559c8a0009a654dcabe Mon Sep 17 00:00:00 2001 From: stefan11111 Date: Sat, 22 Aug 2026 17:26:35 +0300 Subject: [PATCH] glamor_egl: Don't pass an (offset) pointer to glamor_egl's screen private to DRI3 dri3 registers it's own screen private, which invalidates the pointer glamor egl passes. Caught with asan Signed-off-by: stefan11111 --- glamor/glamor_egl.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/glamor/glamor_egl.c b/glamor/glamor_egl.c index 3ac3101d6f..06a7502231 100644 --- a/glamor/glamor_egl.c +++ b/glamor/glamor_egl.c @@ -1726,6 +1726,8 @@ glamor_egl_screen_init(ScreenPtr screen, struct glamor_context *glamor_ctx) * to stay out of the way and let it init DRI3 on its own. */ if (!(glamor_priv->flags & GLAMOR_NO_DRI3)) { + const dri3_screen_info_rec dri3_info = glamor_egl->dri3_info; + /* To do DRI3 device FD generation, we need to open a new fd * to the same device we were handed in originally. */ @@ -1733,7 +1735,7 @@ glamor_egl_screen_init(ScreenPtr screen, struct glamor_context *glamor_ctx) if (!glamor_egl->device_path) glamor_egl->device_path = drmGetDeviceNameFromFd2(glamor_egl->fd); - if (!dri3_screen_init(screen, &glamor_egl->dri3_info)) { + if (!dri3_screen_init(screen, &dri3_info)) { GLAMOR_LOG_STR(screen->myNum, X_ERROR, "Failed to initialize DRI3.\n"); }