Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e02856c0 authored by Jean-Baptiste Queru's avatar Jean-Baptiste Queru Committed by Android Code Review
Browse files

Merge "frameworks/base/opengl: Add NULL check"

parents 812a5686 32938bf4
Loading
Loading
Loading
Loading
+7 −4
Original line number Diff line number Diff line
@@ -843,11 +843,14 @@ EGLBoolean eglChooseConfig( EGLDisplay dpy, const EGLint *attrib_list,
    EGLint patch_index = -1;
    GLint attr;
    size_t size = 0;

    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
        EGLint* new_list = (EGLint*)malloc(size*sizeof(EGLint));