mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-23 22:00:13 +01:00
egl/x11: handle when invalid drawable is passed in create_surface
0 is not used as a valid drawable id, as such there is no point in attempting to query its geometry. Just bail out early and provide the more meaningful EGL_BAD_NATIVE_WINDOW to the user. Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com> Reviewed-by: Marek Olšák <marek.olsak@amd.com>
This commit is contained in:
parent
4ea5223a95
commit
af2aea40d2
1 changed files with 4 additions and 0 deletions
|
|
@ -235,6 +235,10 @@ dri2_x11_create_surface(_EGLDriver *drv, _EGLDisplay *disp, EGLint type,
|
|||
dri2_surf->drawable, screen->root,
|
||||
dri2_surf->base.Width, dri2_surf->base.Height);
|
||||
} else {
|
||||
if (!drawable) {
|
||||
_eglError(EGL_BAD_NATIVE_WINDOW, "dri2_create_surface");
|
||||
goto cleanup_surf;
|
||||
}
|
||||
dri2_surf->drawable = drawable;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue