From: Chia-I Wu Date: Thu, 1 Oct 2009 08:40:09 +0000 (+0800) Subject: egl: Fix eglCheckConfigHandle. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=2fc1614e7a56ab16df1b6ebbc159c58e8212d96d;p=mesa.git egl: Fix eglCheckConfigHandle. A stupid bug by me made the check void. Signed-off-by: Chia-I Wu --- 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); }