diff options
| author | 2010-08-16 08:57:29 -0700 | |
|---|---|---|
| committer | 2010-08-16 08:57:29 -0700 | |
| commit | e02856c0f90f74cf03353b39a654c286b5100584 (patch) | |
| tree | 974c4b074840deffb962750b8fd5294249ca4d6a | |
| parent | 812a5686dfc217d8fe76eafda0f70feb34aa6e39 (diff) | |
| parent | 32938bf45a17c1779debd8a64117e7af853b375e (diff) | |
Merge "frameworks/base/opengl: Add NULL check"
| -rw-r--r-- | opengl/libs/EGL/egl.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/opengl/libs/EGL/egl.cpp b/opengl/libs/EGL/egl.cpp index 40317e7ed7..de740a36b0 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 |