summaryrefslogtreecommitdiffstats
path: root/progs/egl/xeglthreads.c
diff options
context:
space:
mode:
authorChia-I Wu <[email protected]>2010-01-02 21:56:13 +0800
committerChia-I Wu <[email protected]>2010-01-12 10:55:35 +0800
commit3bcb08f6c472b3a7cd752c740b3bbe72c90520fd (patch)
treea89c6ebdfb27a62917da7274900c4dc41b0f32d7 /progs/egl/xeglthreads.c
parent033bd95802448bc82fd6f2ebc722ff1306b578ec (diff)
progs: Check the number of configs returned by eglChooseConfig.
A successful eglChooseConfig call does not imply there are valid configs. Signed-off-by: Chia-I Wu <[email protected]>
Diffstat (limited to 'progs/egl/xeglthreads.c')
-rw-r--r--progs/egl/xeglthreads.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/progs/egl/xeglthreads.c b/progs/egl/xeglthreads.c
index 7d056ebc6f7..5787faecb90 100644
--- a/progs/egl/xeglthreads.c
+++ b/progs/egl/xeglthreads.c
@@ -485,7 +485,8 @@ create_window(struct winthread *wt, EGLContext shareCtx)
scrnum = DefaultScreen(wt->Dpy);
root = RootWindow(wt->Dpy, scrnum);
- if (!eglChooseConfig(wt->Display, attribs, &config, 1, &num_configs)) {
+ if (!eglChooseConfig(wt->Display, attribs, &config, 1, &num_configs) ||
+ !num_configs) {
Error("Unable to choose an EGL config");
}