egl: added null ptr check
authorBrian Paul <brian.paul@tungstengraphics.com>
Fri, 20 Jun 2008 20:28:59 +0000 (14:28 -0600)
committerBrian Paul <brian.paul@tungstengraphics.com>
Fri, 20 Jun 2008 20:28:59 +0000 (14:28 -0600)
src/egl/main/egldisplay.c

index 540efd4fee506cedc1bd5a1a886ffee4d1d1ef15..47a2323eafb3923e508fdb9527dcc64c3983d243 100644 (file)
@@ -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);
 }