1
0
mirror of https://github.com/mpv-player/mpv synced 2024-12-23 23:32:26 +00:00

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.
This commit is contained in:
wm4 2014-08-28 01:32:22 +02:00
parent 2c99464b47
commit a95cfac078

View File

@ -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