Mesa (master): egl: avoid dereferencing a null display

Eric Engeström eric_engestrom at kemper.freedesktop.org
Mon May 8 10:46:10 UTC 2017


Module: Mesa
Branch: master
Commit: dc795f85a56ee95f16ef33c7cf6b373506c9b0d6
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=dc795f85a56ee95f16ef33c7cf6b373506c9b0d6

Author: Eric Engestrom <eric at engestrom.ch>
Date:   Sun May  7 23:44:12 2017 +0100

egl: avoid dereferencing a null display

Fixes: ddb99127a6f6c ("egl/x11: Honor the EGL_PLATFORM_X11_SCREEN_EXT attribute")
Signed-off-by: Eric Engestrom <eric at engestrom.ch>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin at intel.com>

---

 src/egl/main/egldisplay.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/egl/main/egldisplay.c b/src/egl/main/egldisplay.c
index b047a5de42..c4b0fd6aab 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;




More information about the mesa-commit mailing list