diff options
author | Alan Hourihane <alanh@vmware.com> | 2009-02-19 11:01:01 +0000 |
---|---|---|
committer | Alan Hourihane <alanh@vmware.com> | 2009-02-19 11:24:53 +0000 |
commit | 44054aca36580440f956f0cbcdd5f31de8e3a7e2 (patch) | |
tree | 953d5ceb07697a4f2d823d9c8e3c1d8a37cc5b3f /src/egl/drivers/glx | |
parent | 65fde5be8bd5e485dd69afc244568f164cf24fa4 (diff) |
egl: error checking
Diffstat (limited to 'src/egl/drivers/glx')
-rw-r--r-- | src/egl/drivers/glx/egl_glx.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/egl/drivers/glx/egl_glx.c b/src/egl/drivers/glx/egl_glx.c index 8ba70ba7a6..72c1eefbc8 100644 --- a/src/egl/drivers/glx/egl_glx.c +++ b/src/egl/drivers/glx/egl_glx.c @@ -277,6 +277,8 @@ get_fbconfig_attribs(Display *dpy, GLXFBConfig fbconfig, /* We don't use the GLX_FBCONFIG_ID here */ glXGetFBConfigAttrib(dpy, fbconfig, GLX_VISUAL_ID, &attribs->id); + if (attribs->id == 0) + return GL_FALSE; #if 0 attribs->depth = vInfo->depth; @@ -344,6 +346,7 @@ create_configs(_EGLDisplay *disp, struct GLX_egl_driver *GLX_drv) int numVisuals; long mask; int i; + int egl_configs = 1; struct visual_attribs attribs; GLX_drv->fbconfigs = NULL; @@ -365,7 +368,7 @@ create_configs(_EGLDisplay *disp, struct GLX_egl_driver *GLX_drv) config = CALLOC_STRUCT(GLX_egl_config); - _eglInitConfig(&config->Base, i+1); + _eglInitConfig(&config->Base, egl_configs++); SET_CONFIG_ATTRIB(&config->Base, EGL_NATIVE_VISUAL_ID, attribs.id); SET_CONFIG_ATTRIB(&config->Base, EGL_BUFFER_SIZE, attribs.bufferSize); SET_CONFIG_ATTRIB(&config->Base, EGL_RED_SIZE, attribs.redSize); @@ -403,7 +406,7 @@ xvisual: config = CALLOC_STRUCT(GLX_egl_config); - _eglInitConfig(&config->Base, i+1); + _eglInitConfig(&config->Base, egl_configs++); SET_CONFIG_ATTRIB(&config->Base, EGL_NATIVE_VISUAL_ID, attribs.id); SET_CONFIG_ATTRIB(&config->Base, EGL_BUFFER_SIZE, attribs.bufferSize); SET_CONFIG_ATTRIB(&config->Base, EGL_RED_SIZE, attribs.redSize); |