From fe245914114588f272b0924538fdd43f6c127a26 Mon Sep 17 00:00:00 2001 From: Tatsuya Yatagawa Date: Sat, 5 Jun 2021 23:27:31 +0900 Subject: [PATCH] Backends: OpenGL3: Fix access violation due to NULL from glGetStringi. (#4201) --- backends/imgui_impl_opengl3.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backends/imgui_impl_opengl3.cpp b/backends/imgui_impl_opengl3.cpp index 2ff804ef..712de9b2 100644 --- a/backends/imgui_impl_opengl3.cpp +++ b/backends/imgui_impl_opengl3.cpp @@ -247,7 +247,7 @@ bool ImGui_ImplOpenGL3_Init(const char* glsl_version) for (GLint i = 0; i < num_extensions; i++) { const char* extension = (const char*)glGetStringi(GL_EXTENSIONS, i); - if (strcmp(extension, "GL_ARB_clip_control") == 0) + if (extension != NULL && strcmp(extension, "GL_ARB_clip_control") == 0) g_HasClipOrigin = true; } #endif