summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2016-04-08 10:57:21 +0200
committerwm4 <wm4@nowhere>2016-04-08 10:57:21 +0200
commit6325bdf197283e6a6342d229208d58fd1c3e841c (patch)
treefc56db73f90bf6d4c5d6f0f66a9a1732ac45d808
parent813372d6e9e260ab886c014801b98976dcffa32c (diff)
downloadmpv-6325bdf197283e6a6342d229208d58fd1c3e841c.tar.bz2
mpv-6325bdf197283e6a6342d229208d58fd1c3e841c.tar.xz
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.
-rw-r--r--video/out/opengl/common.c4
1 files changed, 3 insertions, 1 deletions
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;