diff options
author | Chia-I Wu <[email protected]> | 2010-01-02 21:56:13 +0800 |
---|---|---|
committer | Chia-I Wu <[email protected]> | 2010-01-12 10:55:35 +0800 |
commit | 3bcb08f6c472b3a7cd752c740b3bbe72c90520fd (patch) | |
tree | a89c6ebdfb27a62917da7274900c4dc41b0f32d7 /progs/egl/xegl_tri.c | |
parent | 033bd95802448bc82fd6f2ebc722ff1306b578ec (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/xegl_tri.c')
-rw-r--r-- | progs/egl/xegl_tri.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/progs/egl/xegl_tri.c b/progs/egl/xegl_tri.c index 8c4d7f973c7..1f1a005a210 100644 --- a/progs/egl/xegl_tri.c +++ b/progs/egl/xegl_tri.c @@ -139,7 +139,8 @@ make_x_window(Display *x_dpy, EGLDisplay egl_dpy, scrnum = DefaultScreen( x_dpy ); root = RootWindow( x_dpy, scrnum ); - if (!eglChooseConfig( egl_dpy, attribs, &config, 1, &num_configs)) { + if (!eglChooseConfig( egl_dpy, attribs, &config, 1, &num_configs) || + !num_configs) { printf("Error: couldn't get an EGL visual config\n"); exit(1); } |