egl: Display may be NULL in _eglLookup*.
This fixes several NULL dereferences.
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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 */
|
||||
|
||||
@@ -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++) {
|
||||
|
||||
Reference in New Issue
Block a user