From eabbb20d17164092a886b462d3711bfa18eabd21 Mon Sep 17 00:00:00 2001 From: Camilla Berglund Date: Fri, 1 Nov 2013 13:55:33 +0100 Subject: [PATCH] Added NULL test for glGetStringi. --- src/context.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/context.c b/src/context.c index 456413b5..ca7b8d61 100644 --- a/src/context.c +++ b/src/context.c @@ -595,11 +595,12 @@ GLFWAPI int glfwExtensionSupported(const char* extension) for (i = 0; i < count; i++) { - if (strcmp((const char*) window->GetStringi(GL_EXTENSIONS, i), - extension) == 0) - { - return GL_TRUE; - } + const char* en = (const char*) window->GetStringi(GL_EXTENSIONS, i); + if (en != NULL) + { + if (strcmp(en, extension) == 0) + return GL_TRUE; + } } } #endif // _GLFW_USE_OPENGL