From: Tomasz Figa Date: Fri, 15 Jul 2016 07:53:48 +0000 (+0900) Subject: egl/android: Check return value of dri2_get_dri_config() X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=94282b6dd0e7c15030b09b6789a7aa5a15e8a869;p=mesa.git egl/android: Check return value of dri2_get_dri_config() It might return NULL if specific config variant is unsupported. Cc: "11.2 12.0" Signed-off-by: Tomasz Figa Reviewed-by: Eric Anholt Reviewed-by: Emil Velikov --- diff --git a/src/egl/drivers/dri2/platform_android.c b/src/egl/drivers/dri2/platform_android.c index b33f4e8c8b0..302eb8509c2 100644 --- a/src/egl/drivers/dri2/platform_android.c +++ b/src/egl/drivers/dri2/platform_android.c @@ -280,6 +280,8 @@ droid_create_surface(_EGLDriver *drv, _EGLDisplay *disp, EGLint type, config = dri2_get_dri_config(dri2_conf, EGL_WINDOW_BIT, dri2_surf->base.GLColorspace); + if (!config) + goto cleanup_surface; dri2_surf->dri_drawable = (*dri2_dpy->dri2->createNewDrawable)(dri2_dpy->dri_screen, config,