diff --git a/.pick_status.json b/.pick_status.json index f149ac84b39..cabc6b71c20 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -121,7 +121,7 @@ "description": "egl/wayland: Error on invalid native window", "nominated": true, "nomination_type": 0, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": null }, diff --git a/src/egl/drivers/dri2/platform_wayland.c b/src/egl/drivers/dri2/platform_wayland.c index 180380b4c4c..8d78e8c7e74 100644 --- a/src/egl/drivers/dri2/platform_wayland.c +++ b/src/egl/drivers/dri2/platform_wayland.c @@ -311,6 +311,16 @@ dri2_wl_create_window_surface(_EGLDisplay *disp, _EGLConfig *conf, int visual_idx; const __DRIconfig *config; + if (!window) { + _eglError(EGL_BAD_NATIVE_WINDOW, "dri2_create_surface"); + return NULL; + } + + if (window->driver_private) { + _eglError(EGL_BAD_ALLOC, "dri2_create_surface"); + return NULL; + } + dri2_surf = calloc(1, sizeof *dri2_surf); if (!dri2_surf) { _eglError(EGL_BAD_ALLOC, "dri2_create_surface");