From a95cfac07876a134f43d1e033720c9e5d847b5be Mon Sep 17 00:00:00 2001 From: wm4 Date: Thu, 28 Aug 2014 01:32:22 +0200 Subject: [PATCH] vo_opengl: don't pass (char*)NULL as %s printf argument glGetString(GL_SHADING_LANGUAGE_VERSION) can return NULL; I suppose this happens on legacy OpenGL, while all the other fields are guaranteed to exist. --- video/out/gl_common.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/video/out/gl_common.c b/video/out/gl_common.c index d6f3708b01..49fd078f6c 100644 --- a/video/out/gl_common.c +++ b/video/out/gl_common.c @@ -497,8 +497,9 @@ void mpgl_load_functions(GL *gl, void *(*getProcAddress)(const GLubyte *), mp_verbose(log, "GL_VENDOR='%s'\n", gl->GetString(GL_VENDOR)); mp_verbose(log, "GL_RENDERER='%s'\n", gl->GetString(GL_RENDERER)); mp_verbose(log, "GL_VERSION='%s'\n", gl->GetString(GL_VERSION)); - mp_verbose(log, "GL_SHADING_LANGUAGE_VERSION='%s'\n", - gl->GetString(GL_SHADING_LANGUAGE_VERSION)); + const char *shader = gl->GetString(GL_SHADING_LANGUAGE_VERSION); + if (shader) + mp_verbose(log, "GL_SHADING_LANGUAGE_VERSION='%s'\n", shader); // Note: This code doesn't handle CONTEXT_FORWARD_COMPATIBLE_BIT_ARB // on OpenGL 3.0 correctly. Apparently there's no way to detect this