egl: Fail properly if no configs are available instead of crashing

This commit is contained in:
Benjamin Otte 2010-06-18 19:26:07 +02:00
parent 3908d80f57
commit c3eb95bf66

View file

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