From d708651c537623d09bf3c13a764c24259c4cc9a6 Mon Sep 17 00:00:00 2001 From: Geoffrey McRae Date: Wed, 5 Jan 2022 12:38:38 +1100 Subject: [PATCH] [client] egl: check for null gl strings --- client/renderers/EGL/egl.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/client/renderers/EGL/egl.c b/client/renderers/EGL/egl.c index 6d179776..d5f4aa5d 100644 --- a/client/renderers/EGL/egl.c +++ b/client/renderers/EGL/egl.c @@ -766,6 +766,12 @@ static bool egl_renderStartup(LG_Renderer * renderer, bool useDMA) } const char * client_exts = eglQueryString(this->display, EGL_EXTENSIONS); + if (!client_exts) + { + DEBUG_ERROR("Failed to query EGL_EXTENSIONS"); + return false; + } + bool debugContext = option_get_bool("egl", "debug"); EGLint ctxattr[5]; int ctxidx = 0; @@ -814,7 +820,18 @@ static bool egl_renderStartup(LG_Renderer * renderer, bool useDMA) eglMakeCurrent(this->display, this->surface, this->surface, this->context); const char * gl_exts = (const char *)glGetString(GL_EXTENSIONS); + if (!gl_exts) + { + DEBUG_ERROR("Failed to query GL_EXTENSIONS"); + return false; + } + const char * vendor = (const char *)glGetString(GL_VENDOR); + if (!vendor) + { + DEBUG_ERROR("Failed to query GL_VENDOR"); + return false; + } DEBUG_INFO("EGL : %d.%d", maj, min); DEBUG_INFO("Vendor : %s", vendor);