From 6325bdf197283e6a6342d229208d58fd1c3e841c Mon Sep 17 00:00:00 2001 From: wm4 Date: Fri, 8 Apr 2016 10:57:21 +0200 Subject: vo_opengl: log if glGetString(GL_VERSION) returns NULL Typically happens with some implementations if no context is currrent, or is otherwise broken. This is particularly relevant to the opengl_cb API, because the API user will have no other indication what went wrong. --- video/out/opengl/common.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/video/out/opengl/common.c b/video/out/opengl/common.c index f08fd4bfd9..46cbc2fc8c 100644 --- a/video/out/opengl/common.c +++ b/video/out/opengl/common.c @@ -369,8 +369,10 @@ void mpgl_load_functions2(GL *gl, void *(*get_fn)(void *ctx, const char *n), int major = 0, minor = 0; const char *version_string = gl->GetString(GL_VERSION); - if (!version_string) + if (!version_string) { + mp_fatal(log, "glGetString(GL_VERSION) returned NULL.\n"); goto error; + } mp_verbose(log, "GL_VERSION='%s'\n", version_string); if (strncmp(version_string, "OpenGL ES ", 10) == 0) { version_string += 10; -- cgit v1.2.3