Skip to content

Commit bcbb584

Browse files
Jean-Baptiste QueruAndroid Code Review
authored andcommitted
Merge "frameworks/base/opengl: Add NULL check"
2 parents c636b84 + 184d50f commit bcbb584

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

opengl/libs/EGL/egl.cpp

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -843,10 +843,13 @@ EGLBoolean eglChooseConfig( EGLDisplay dpy, const EGLint *attrib_list,
843843
EGLint patch_index = -1;
844844
GLint attr;
845845
size_t size = 0;
846-
while ((attr=attrib_list[size]) != EGL_NONE) {
847-
if (attr == EGL_CONFIG_ID)
848-
patch_index = size;
849-
size += 2;
846+
847+
if (attrib_list != NULL) {
848+
while ((attr=attrib_list[size]) != EGL_NONE) {
849+
if (attr == EGL_CONFIG_ID)
850+
patch_index = size;
851+
size += 2;
852+
}
850853
}
851854
if (patch_index >= 0) {
852855
size += 2; // we need copy the sentinel as well

0 commit comments

Comments
 (0)