summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Storsjo <martin@martin.st>2013-08-11 22:05:26 +0300
committerMartin Storsjo <martin@martin.st>2013-08-11 22:05:59 +0300
commit8763ae7362f86fff1d40235f46847f975e74e20d (patch)
treeb05a63d7da119e7cf56c3ba8788d1491dd05ebef
parent8f9288eaf10b50d19038f5c7024616e147c64735 (diff)
downloadandroid_device_generic_goldfish-8763ae7362f86fff1d40235f46847f975e74e20d.tar.gz
android_device_generic_goldfish-8763ae7362f86fff1d40235f46847f975e74e20d.tar.bz2
android_device_generic_goldfish-8763ae7362f86fff1d40235f46847f975e74e20d.zip
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
-rw-r--r--opengl/system/egl/egl.cpp2
1 files changed, 2 insertions, 0 deletions
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;
}