From: Eric Engestrom Date: Sun, 7 May 2017 22:44:12 +0000 (+0100) Subject: egl: avoid dereferencing a null display X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=dc795f85a56ee95f16ef33c7cf6b373506c9b0d6;p=mesa.git egl: avoid dereferencing a null display Fixes: ddb99127a6f6c ("egl/x11: Honor the EGL_PLATFORM_X11_SCREEN_EXT attribute") Signed-off-by: Eric Engestrom Reviewed-by: Lionel Landwerlin --- diff --git a/src/egl/main/egldisplay.c b/src/egl/main/egldisplay.c index b047a5de429..c4b0fd6aab1 100644 --- a/src/egl/main/egldisplay.c +++ b/src/egl/main/egldisplay.c @@ -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;