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);