summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-08-28 01:32:22 +0200
committerwm4 <wm4@nowhere>2014-08-28 01:52:15 +0200
commita95cfac07876a134f43d1e033720c9e5d847b5be (patch)
treeca1de20e284b9cbd14d117bcfdfb4341a6c02c18
parent2c99464b475d01e1fb3f96904dc905eef6197008 (diff)
downloadmpv-a95cfac07876a134f43d1e033720c9e5d847b5be.tar.bz2
mpv-a95cfac07876a134f43d1e033720c9e5d847b5be.tar.xz
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.
-rw-r--r--video/out/gl_common.c5
1 files 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