summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/egl/main/eglconfig.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/egl/main/eglconfig.c b/src/egl/main/eglconfig.c
index 2c8d1c4055b..31d69a77080 100644
--- a/src/egl/main/eglconfig.c
+++ b/src/egl/main/eglconfig.c
@@ -82,18 +82,17 @@ _eglAddConfig(_EGLDisplay *dpy, _EGLConfig *conf)
EGLBoolean
_eglCheckConfigHandle(EGLConfig config, _EGLDisplay *dpy)
{
- _EGLConfig *conf = NULL;
+ EGLint num_configs = (dpy) ? dpy->NumConfigs : 0;
EGLint i;
- for (i = 0; dpy && i < dpy->NumConfigs; i++) {
- conf = dpy->Configs[i];
+ for (i = 0; i < num_configs; i++) {
+ _EGLConfig *conf = dpy->Configs[i];
if (conf == (_EGLConfig *) config) {
assert(conf->Display == dpy);
break;
}
}
-
- return (conf != NULL);
+ return (i < num_configs);
}