From: Brian Paul Date: Fri, 20 Jun 2008 20:28:59 +0000 (-0600) Subject: egl: added null ptr check X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=677151ad71d7f0792fb79597e972e2cad2cfc7d4;p=mesa.git egl: added null ptr check --- diff --git a/src/egl/main/egldisplay.c b/src/egl/main/egldisplay.c index 540efd4fee5..47a2323eafb 100644 --- a/src/egl/main/egldisplay.c +++ b/src/egl/main/egldisplay.c @@ -68,8 +68,9 @@ _EGLDisplay * _eglLookupDisplay(EGLDisplay dpy) { EGLuint key = (EGLuint) dpy; - _EGLDisplay *d = (_EGLDisplay *) _eglHashLookup(_eglGlobal.Displays, key); - return d; + if (!_eglGlobal.Displays) + return NULL; + return (_EGLDisplay *) _eglHashLookup(_eglGlobal.Displays, key); }