summaryrefslogtreecommitdiffstats
path: root/src/egl/drivers/dri2/platform_android.c
diff options
context:
space:
mode:
authorTomasz Figa <tfiga@chromium.org>2016-07-15 16:53:48 +0900
committerEmil Velikov <emil.l.velikov@gmail.com>2016-07-20 15:47:23 +0100
commit94282b6dd0e7c15030b09b6789a7aa5a15e8a869 (patch)
treec1c27fb07d34cd3d85f6272c604df2246dedbe46 /src/egl/drivers/dri2/platform_android.c
parent4f48674d51f03d8c954a89dfc49539a1dc750c4d (diff)
downloadexternal_mesa3d-94282b6dd0e7c15030b09b6789a7aa5a15e8a869.zip
external_mesa3d-94282b6dd0e7c15030b09b6789a7aa5a15e8a869.tar.gz
external_mesa3d-94282b6dd0e7c15030b09b6789a7aa5a15e8a869.tar.bz2
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" <mesa-stable@lists.freedesktop.org> Signed-off-by: Tomasz Figa <tfiga@chromium.org> Reviewed-by: Eric Anholt <eric@anholt.net> Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Diffstat (limited to 'src/egl/drivers/dri2/platform_android.c')
-rw-r--r--src/egl/drivers/dri2/platform_android.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/egl/drivers/dri2/platform_android.c b/src/egl/drivers/dri2/platform_android.c
index b33f4e8..302eb85 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,