From 8763ae7362f86fff1d40235f46847f975e74e20d Mon Sep 17 00:00:00 2001 From: Martin Storsjo Date: Sun, 11 Aug 2013 22:05:26 +0300 Subject: Return EGL_FALSE if eglChooseConfig failed to find any matching configs Technically, we shouldn't have touched *num_config at all in this case, but the remote interface to the host doesn't return a separate boolean return value, only the number of matching configs. This makes sure that callers that only check the return value of eglChooseConfig notice a failure to find configs. Change-Id: I7f660a4a5b8306184608a86c34329d3163ad05ba --- opengl/system/egl/egl.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/opengl/system/egl/egl.cpp b/opengl/system/egl/egl.cpp index da89c4d..9babde9 100644 --- a/opengl/system/egl/egl.cpp +++ b/opengl/system/egl/egl.cpp @@ -588,6 +588,8 @@ EGLBoolean eglChooseConfig(EGLDisplay dpy, const EGLint *attrib_list, EGLConfig DEFINE_AND_VALIDATE_HOST_CONNECTION(EGL_FALSE); *num_config = rcEnc->rcChooseConfig(rcEnc, (EGLint*)attrib_list, attribs_size * sizeof(EGLint), (uint32_t*)configs, config_size); + if (*num_config <= 0) + return EGL_FALSE; return EGL_TRUE; } -- cgit v1.2.3