[Mesa-dev] [PATCH mesa] egl: avoid dereferencing a null display
Lionel Landwerlin
lionel.g.landwerlin at intel.com
Mon May 8 08:13:04 UTC 2017
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin at intel.com>
On 07/05/17 23:48, Eric Engestrom wrote:
> 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;
More information about the mesa-dev
mailing list