mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-31 04:50:34 +01:00
egl_dri2: NULL check for EGLNativeWindowType
Some application calls eglCreateWindowSurface with EGLNativeWindowType parameter having zero value. It causes SEGV and disturbs error handling like EGL_NO_SURFACE. Signed-off-by: Elvis Lee <kwangwoong.lee@lge.com> Signed-off-by: Brian Paul <brianp@vmware.com>
This commit is contained in:
parent
d80fd04639
commit
cf775c9cbf
1 changed files with 2 additions and 0 deletions
|
|
@ -108,6 +108,8 @@ dri2_create_surface(_EGLDriver *drv, _EGLDisplay *disp, EGLint type,
|
|||
|
||||
switch (type) {
|
||||
case EGL_WINDOW_BIT:
|
||||
if (!window)
|
||||
return NULL;
|
||||
surf = gbm_dri_surface((struct gbm_surface *) window);
|
||||
dri2_surf->gbm_surf = surf;
|
||||
dri2_surf->base.Width = surf->base.width;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue