Backends: OpenGL3: Fix access violation due to NULL from glGetStringi. (#4201)

This commit is contained in:
Tatsuya Yatagawa 2021-06-05 23:27:31 +09:00 committed by GitHub
parent 94b680e830
commit fe24591411
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -247,7 +247,7 @@ bool ImGui_ImplOpenGL3_Init(const char* glsl_version)
for (GLint i = 0; i < num_extensions; i++) for (GLint i = 0; i < num_extensions; i++)
{ {
const char* extension = (const char*)glGetStringi(GL_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; g_HasClipOrigin = true;
} }
#endif #endif