summaryrefslogtreecommitdiffstats
path: root/opengl/libagl
diff options
context:
space:
mode:
authorMathias Agopian <mathias@google.com>2010-05-17 14:45:43 -0700
committerMathias Agopian <mathias@google.com>2010-05-17 14:45:43 -0700
commit7e71fcf31ecd23b0b4c3cd2b25cd3b11e53c7428 (patch)
tree2867f6b248c4b3cf6f5ac884360039ad19fc99eb /opengl/libagl
parenteb8f850d0b7e53956e917fd9645f808c1a09bc88 (diff)
downloadframeworks_base-7e71fcf31ecd23b0b4c3cd2b25cd3b11e53c7428.zip
frameworks_base-7e71fcf31ecd23b0b4c3cd2b25cd3b11e53c7428.tar.gz
frameworks_base-7e71fcf31ecd23b0b4c3cd2b25cd3b11e53c7428.tar.bz2
fix a crasher in our EGL wrapper when attrib_list is NULL in eglChooseConfig
the EGL specification states that this should be treated as though it was an empty list terminated with EGL_NONE. Change-Id: I294104370a86b5e5c34c7bcf15c5459eab464631
Diffstat (limited to 'opengl/libagl')
-rw-r--r--opengl/libagl/egl.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/opengl/libagl/egl.cpp b/opengl/libagl/egl.cpp
index b6e0aae..7cb01d0 100644
--- a/opengl/libagl/egl.cpp
+++ b/opengl/libagl/egl.cpp
@@ -1525,8 +1525,13 @@ EGLBoolean eglChooseConfig( EGLDisplay dpy, const EGLint *attrib_list,
}
if (ggl_unlikely(attrib_list==0)) {
- *num_config = 0;
- return EGL_TRUE;
+ /*
+ * A NULL attrib_list should be treated as though it was an empty
+ * one (terminated with EGL_NONE) as defined in
+ * section 3.4.1 "Querying Configurations" in the EGL specification.
+ */
+ static const EGLint dummy = EGL_NONE;
+ attrib_list = &dummy;
}
int numAttributes = 0;