From e11b1a733cacd64b2ebebe9cd72caadaa52b3c32 Mon Sep 17 00:00:00 2001 From: Tom Hudson Date: Tue, 23 Sep 2014 12:00:41 -0400 Subject: [PATCH] Return EGL_FALSE early when eglInitialize() fails In the Meta-EGL shim, eglInitialize() could fail but return EGL_TRUE, writing into the version numbers; both of these behaviors contradict the spec. BUG=b/17486830 R=jessehall@google.com Change-Id: I810bdbd701e222ac09ab8660ce9dfc0c0954c3d7 --- opengl/libs/EGL/egl_display.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/opengl/libs/EGL/egl_display.cpp b/opengl/libs/EGL/egl_display.cpp index 7784ca6ac..77a5f11b7 100644 --- a/opengl/libs/EGL/egl_display.cpp +++ b/opengl/libs/EGL/egl_display.cpp @@ -171,6 +171,7 @@ EGLBoolean egl_display_t::initialize(EGLint *major, EGLint *minor) { } else { ALOGW("eglInitialize(%p) failed (%s)", idpy, egl_tls_t::egl_strerror(cnx->egl.eglGetError())); + return EGL_FALSE; } }