summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorElvis Lee <[email protected]>2012-07-11 11:13:51 +0900
committerBrian Paul <[email protected]>2012-07-16 16:03:31 -0600
commitcf775c9cbf86676aa321eb9665fe38aeba35afc9 (patch)
tree22623da8d8ea8bf36a4daffe8beac9eabfa429ce
parentd80fd04639a6e378c6e13c8ffaa91d43decf58a8 (diff)
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 <[email protected]> Signed-off-by: Brian Paul <[email protected]>
-rw-r--r--src/egl/drivers/dri2/platform_drm.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/egl/drivers/dri2/platform_drm.c b/src/egl/drivers/dri2/platform_drm.c
index 54067ff7814..9aafb525b93 100644
--- a/src/egl/drivers/dri2/platform_drm.c
+++ b/src/egl/drivers/dri2/platform_drm.c
@@ -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;