[Mesa-dev] [PATCH mesa] egl: avoid dereferencing a null display
Eric Engestrom
eric at engestrom.ch
Sun May 7 22:48:25 UTC 2017
Fixes: ddb99127a6f6c ("egl/x11: Honor the EGL_PLATFORM_X11_SCREEN_EXT attribute")
Signed-off-by: Eric Engestrom <eric at engestrom.ch>
---
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;
--
Cheers,
Eric
More information about the mesa-dev
mailing list