aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLingfeng Yang <lfy@google.com>2018-10-09 02:27:07 -0700
committerLingfeng Yang <lfy@google.com>2018-10-12 10:04:02 -0700
commit64bb1574822e3b8339a067a99d0e330290e5dc30 (patch)
treeec04319d63a1445a931c66962338e3c768263e99
parentdc0912068647f594dd0e6de2447cced951811ace (diff)
downloaddevice_generic_goldfish-opengl-64bb1574822e3b8339a067a99d0e330290e5dc30.tar.gz
device_generic_goldfish-opengl-64bb1574822e3b8339a067a99d0e330290e5dc30.tar.bz2
device_generic_goldfish-opengl-64bb1574822e3b8339a067a99d0e330290e5dc30.zip
Fix missing entries for eglGetProcAddress
bug: 117630404 GL_OES_vertex_array_object and GL_OES_map_buffer may be queried from user apps with eglGetProcAddress, their entries were missing. From the EGL 1.4 spec: eglGetProcAddress may be queried for all of the following functions: - All EGL and client API extension functions supported by the implementation (whether those extensions are supported by the current client API context or not). This includes any mandatory OpenGL ES extensions. + Fixed a global buffer overflow where if GLES3 enabled, the client major version is set to 3, and we index into the third table, which doesn't exist (No idea how gles3 ever worked with this overflow; ASAN also did not catch this) Change-Id: I9639f5c912aee634457ff62bee9d79781bf2e2d4
-rw-r--r--system/egl/ClientAPIExts.cpp3
-rw-r--r--system/egl/ClientAPIExts.in24
2 files changed, 26 insertions, 1 deletions
diff --git a/system/egl/ClientAPIExts.cpp b/system/egl/ClientAPIExts.cpp
index 0f02dcb8..40644e74 100644
--- a/system/egl/ClientAPIExts.cpp
+++ b/system/egl/ClientAPIExts.cpp
@@ -97,7 +97,8 @@ void initClientFuncs(const EGLClient_glesInterface *iface, int idx)
if (!thread->currentContext) { \
return; \
} \
- int idx = (int)thread->currentContext->majorVersion - 1; \
+ int clientMajorVersion = (int)thread->currentContext->majorVersion; \
+ int idx = clientMajorVersion == 1 ? 0 : 1; \
if (!s_client_extensions[idx].fname) { \
return; \
} \
diff --git a/system/egl/ClientAPIExts.in b/system/egl/ClientAPIExts.in
index 58507019..a4595f2e 100644
--- a/system/egl/ClientAPIExts.in
+++ b/system/egl/ClientAPIExts.in
@@ -199,3 +199,27 @@ API_ENTRY(glDrawTexfvOES,
API_ENTRY(glDrawTexxvOES,
(const GLfixed *coords),
(coords))
+
+API_ENTRY(glBindVertexArrayOES,
+ (GLuint array),
+ (array))
+
+API_ENTRY(glDeleteVertexArraysOES,
+ (GLsizei n, const GLuint* arrays),
+ (n, arrays))
+
+API_ENTRY(glGenVertexArraysOES,
+ (GLsizei n, GLuint* arrays),
+ (n, arrays))
+
+API_ENTRY(glIsVertexArrayOES,
+ (GLuint array),
+ (array))
+
+API_ENTRY(glMapBufferOES,
+ (GLenum target, GLenum access),
+ (target, access))
+
+API_ENTRY(glUnmapBufferOES,
+ (GLenum target),
+ (target)) \ No newline at end of file