summaryrefslogtreecommitdiffstats
path: root/src/gallium/state_trackers/egl
diff options
context:
space:
mode:
authorChia-I Wu <[email protected]>2010-12-26 23:34:57 +0800
committerChia-I Wu <[email protected]>2010-12-26 23:35:50 +0800
commit9f2062fb12aa4e0d69583e88e70080efe70e1967 (patch)
tree314e6c9bd9d73149048736ac966ad9acef813834 /src/gallium/state_trackers/egl
parentaa68dd9a49d4d78fb4bf0b7674cc51da7c608092 (diff)
st/egl: Fix eglChooseConfig when configs is NULL.
When configs is NULL, the app wants to know the number of matching configs.
Diffstat (limited to 'src/gallium/state_trackers/egl')
-rw-r--r--src/gallium/state_trackers/egl/common/egl_g3d_api.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/gallium/state_trackers/egl/common/egl_g3d_api.c b/src/gallium/state_trackers/egl/common/egl_g3d_api.c
index bce901ac9a9..c9f94a3c498 100644
--- a/src/gallium/state_trackers/egl/common/egl_g3d_api.c
+++ b/src/gallium/state_trackers/egl/common/egl_g3d_api.c
@@ -158,17 +158,17 @@ egl_g3d_choose_config(_EGLDriver *drv, _EGLDisplay *dpy, const EGLint *attribs,
(_EGLArrayForEach) egl_g3d_match_config, (void *) &criteria);
/* perform sorting of configs */
- if (tmp_configs && tmp_size) {
+ if (configs && tmp_size) {
_eglSortConfigs((const _EGLConfig **) tmp_configs, tmp_size,
egl_g3d_compare_config, (void *) &criteria);
- size = MIN2(tmp_size, size);
- for (i = 0; i < size; i++)
+ tmp_size = MIN2(tmp_size, size);
+ for (i = 0; i < tmp_size; i++)
configs[i] = _eglGetConfigHandle(tmp_configs[i]);
}
FREE(tmp_configs);
- *num_configs = size;
+ *num_configs = tmp_size;
return EGL_TRUE;
}