egl: avoid dereferencing a null display
authorEric Engestrom <eric@engestrom.ch>
Sun, 7 May 2017 22:44:12 +0000 (23:44 +0100)
committerEric Engestrom <eric@engestrom.ch>
Mon, 8 May 2017 10:43:36 +0000 (11:43 +0100)
Fixes: ddb99127a6f6c ("egl/x11: Honor the EGL_PLATFORM_X11_SCREEN_EXT attribute")
Signed-off-by: Eric Engestrom <eric@engestrom.ch>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
src/egl/main/egldisplay.c

index b047a5de4295e57ec9469a2e9c5a2b62d62513e7..c4b0fd6aab17b29987a00ef46e6596af00b5cc6a 100644 (file)
@@ -505,8 +505,10 @@ _eglGetX11Display(Display *native_display,
    _EGLDisplay *display = _eglFindDisplay(_EGL_PLATFORM_X11,
                                           native_display);
 
-   if (!display)
+   if (!display) {
       _eglError(EGL_BAD_ALLOC, "eglGetPlatformDisplay");
+      return NULL;
+   }
 
    if (!_eglParseX11DisplayAttribList(display, attrib_list)) {
       return NULL;