summaryrefslogtreecommitdiffstats
path: root/src/egl
diff options
context:
space:
mode:
authorChia-I Wu <olvaffe@gmail.com>2009-10-01 16:40:09 +0800
committerBrian Paul <brianp@vmware.com>2009-10-15 12:53:55 -0600
commit2fc1614e7a56ab16df1b6ebbc159c58e8212d96d (patch)
treed5dd35ea85b9eeba73934c8b339413c2ec30e190 /src/egl
parent72fd1cf292937565a182b400595816c6ad88836a (diff)
egl: Fix eglCheckConfigHandle.
A stupid bug by me made the check void. Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Diffstat (limited to 'src/egl')
-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);
}