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
diff --git a/system/egl/ClientAPIExts.cpp b/system/egl/ClientAPIExts.cpp
index 0f02dcb..40644e7 100644
--- a/system/egl/ClientAPIExts.cpp
+++ b/system/egl/ClientAPIExts.cpp
@@ -97,7 +97,8 @@
         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 5850701..a4595f2 100644
--- a/system/egl/ClientAPIExts.in
+++ b/system/egl/ClientAPIExts.in
@@ -199,3 +199,27 @@
 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