diff options
author | Benjamin Otte <otte@redhat.com> | 2010-06-18 19:26:07 +0200 |
---|---|---|
committer | Benjamin Otte <otte@redhat.com> | 2010-06-18 19:26:07 +0200 |
commit | c3eb95bf6670bbc06ef908481da95f3504c7dc4d (patch) | |
tree | 9800a6f1414f56a8f4ef5c953ef77613f689b2c4 /boilerplate | |
parent | 3908d80f57bc0abef47721a5b8b9afd5041118e3 (diff) |
egl: Fail properly if no configs are available instead of crashing
Diffstat (limited to 'boilerplate')
-rw-r--r-- | boilerplate/cairo-boilerplate-egl.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/boilerplate/cairo-boilerplate-egl.c b/boilerplate/cairo-boilerplate-egl.c index 413c7ed66..71f9c7533 100644 --- a/boilerplate/cairo-boilerplate-egl.c +++ b/boilerplate/cairo-boilerplate-egl.c @@ -87,6 +87,10 @@ _cairo_boilerplate_egl_create_surface (const char *name, } eglGetConfigs (gltc->dpy, NULL, 0, &numConfigs); + if (numConfigs == 0) { + free (gltc); + return NULL; + } configs = xmalloc(sizeof(*configs) *numConfigs); eglGetConfigs (gltc->dpy, configs, numConfigs, &numConfigs); |