egl: Display may be NULL in _eglLookup*.

This fixes several NULL dereferences.
This commit is contained in:
Chia-I Wu 2010-09-10 00:02:47 +08:00
parent 3ec296390c
commit 08a482e7a9
3 changed files with 3 additions and 3 deletions

View file

@ -117,7 +117,7 @@ static INLINE _EGLConfig *
_eglLookupConfig(EGLConfig config, _EGLDisplay *dpy)
{
_EGLConfig *conf = (_EGLConfig *) config;
if (!_eglCheckConfigHandle(config, dpy))
if (!dpy || !_eglCheckConfigHandle(config, dpy))
conf = NULL;
return conf;
}

View file

@ -25,7 +25,7 @@ _eglLookupMode(EGLModeMESA mode, _EGLDisplay *disp)
{
EGLint scrnum;
if (!disp->Screens)
if (!disp || !disp->Screens)
return NULL;
/* loop over all screens on the display */

View file

@ -69,7 +69,7 @@ _eglLookupScreen(EGLScreenMESA screen, _EGLDisplay *display)
{
EGLint i;
if (!display->Screens)
if (!display || !display->Screens)
return NULL;
for (i = 0; i < display->Screens->Size; i++) {