summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean-Baptiste Queru <jbq@google.com>2010-08-16 08:57:29 -0700
committerAndroid Code Review <code-review@android.com>2010-08-16 08:57:29 -0700
commitbcbb584569873a60acac3c733a9e81374447ea8c (patch)
treec81464ab3338bf4134f4fa5317891c847d3a1883
parentc636b846160482fbebd9a3792d52b9ff864228f2 (diff)
parent184d50f95bc47343b8a324bb6cce94d97b8956df (diff)
downloadframeworks_base-bcbb584569873a60acac3c733a9e81374447ea8c.zip
frameworks_base-bcbb584569873a60acac3c733a9e81374447ea8c.tar.gz
frameworks_base-bcbb584569873a60acac3c733a9e81374447ea8c.tar.bz2
Merge "frameworks/base/opengl: Add NULL check"
-rw-r--r--opengl/libs/EGL/egl.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/opengl/libs/EGL/egl.cpp b/opengl/libs/EGL/egl.cpp
index 40317e7..de740a3 100644
--- a/opengl/libs/EGL/egl.cpp
+++ b/opengl/libs/EGL/egl.cpp
@@ -843,10 +843,13 @@ 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 != NULL) {
+ 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