egl/wayland: validate dri_screen_display_gpu before use

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Simon Ser <contact@emersion.fr>
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/12370
Fixes: d795b4712c ("egl/wayland: only supply LINEAR modifier when supported")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33036>
This commit is contained in:
Pierre-Eric Pelloux-Prayer 2025-01-15 19:10:49 +01:00 committed by Marge Bot
parent 1021d6fe62
commit 40308ef6e5

View file

@ -1224,12 +1224,13 @@ get_back_bo(struct dri2_egl_surface *dri2_surf)
render_modifiers = &linear_mod;
render_num_modifiers = 1;
}
if (dri2_dpy->dri_screen_display_gpu->base.screen->resource_create_with_modifiers) {
display_modifiers = &linear_mod;
display_num_modifiers = 1;
}
if (dri2_dpy->dri_screen_display_gpu) {
if (dri2_dpy->dri_screen_display_gpu->base.screen->resource_create_with_modifiers) {
display_modifiers = &linear_mod;
display_num_modifiers = 1;
}
linear_copy_display_gpu_image = dri_create_image_with_modifiers(
dri2_dpy->dri_screen_display_gpu,
dri2_surf->base.Width, dri2_surf->base.Height,