diff options
author | Mathias Agopian <mathias@google.com> | 2010-05-17 14:45:43 -0700 |
---|---|---|
committer | Mathias Agopian <mathias@google.com> | 2010-05-17 14:45:43 -0700 |
commit | 7e71fcf31ecd23b0b4c3cd2b25cd3b11e53c7428 (patch) | |
tree | 2867f6b248c4b3cf6f5ac884360039ad19fc99eb /opengl/libs | |
parent | eb8f850d0b7e53956e917fd9645f808c1a09bc88 (diff) | |
download | frameworks_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/libs')
-rw-r--r-- | opengl/libs/EGL/egl.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/opengl/libs/EGL/egl.cpp b/opengl/libs/EGL/egl.cpp index e6cf792..ba09d08 100644 --- a/opengl/libs/EGL/egl.cpp +++ b/opengl/libs/EGL/egl.cpp @@ -843,10 +843,12 @@ EGLBoolean eglChooseConfig( EGLDisplay dpy, const EGLint *attrib_list, EGLint patch_index = -1; GLint attr; size_t size = 0; - while ((attr=attrib_list[size]) != EGL_NONE) { - if (attr == EGL_CONFIG_ID) - patch_index = size; - size += 2; + if (attrib_list) { + while ((attr=attrib_list[size]) != EGL_NONE) { + if (attr == EGL_CONFIG_ID) + patch_index = size; + size += 2; + } } if (patch_index >= 0) { size += 2; // we need copy the sentinel as well |