Module: Mesa Branch: master Commit: 2fc1614e7a56ab16df1b6ebbc159c58e8212d96d URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=2fc1614e7a56ab16df1b6ebbc159c58e8212d96d
Author: Chia-I Wu <[email protected]> Date: Thu Oct 1 16:40:09 2009 +0800 egl: Fix eglCheckConfigHandle. A stupid bug by me made the check void. Signed-off-by: Chia-I Wu <[email protected]> --- src/egl/main/eglconfig.c | 9 ++++----- 1 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/egl/main/eglconfig.c b/src/egl/main/eglconfig.c index 2c8d1c4..31d69a7 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); } _______________________________________________ mesa-commit mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/mesa-commit
