From 145ea03ca2f09973802816271a43df2f86da659f Mon Sep 17 00:00:00 2001 From: Camilla Berglund Date: Fri, 1 Jul 2016 18:13:55 +0200 Subject: [PATCH] EGL: Verify all entry points during load --- src/egl_context.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/src/egl_context.c b/src/egl_context.c index e35076d8..7b75d127 100644 --- a/src/egl_context.c +++ b/src/egl_context.c @@ -339,6 +339,28 @@ GLFWbool _glfwInitEGL(void) _glfw.egl.GetProcAddress = (PFNEGLGETPROCADDRESSPROC) _glfw_dlsym(_glfw.egl.handle, "eglGetProcAddress"); + if (!_glfw.egl.GetConfigAttrib || + !_glfw.egl.GetConfigs || + !_glfw.egl.GetDisplay || + !_glfw.egl.GetError || + !_glfw.egl.Initialize || + !_glfw.egl.Terminate || + !_glfw.egl.BindAPI || + !_glfw.egl.CreateContext || + !_glfw.egl.DestroySurface || + !_glfw.egl.DestroyContext || + !_glfw.egl.CreateWindowSurface || + !_glfw.egl.MakeCurrent || + !_glfw.egl.SwapBuffers || + !_glfw.egl.SwapInterval || + !_glfw.egl.QueryString || + !_glfw.egl.GetProcAddress) + { + _glfwInputError(GLFW_PLATFORM_ERROR, + "EGL: Failed to load required entry points"); + return GLFW_FALSE; + } + _glfw.egl.display = eglGetDisplay(_GLFW_EGL_NATIVE_DISPLAY); if (_glfw.egl.display == EGL_NO_DISPLAY) {