diff options
author | Adam Jackson <ajax@redhat.com> | 2018-10-05 14:50:20 -0400 |
---|---|---|
committer | Adam Jackson <ajax@redhat.com> | 2018-10-05 14:50:20 -0400 |
commit | af151895f3cb1755a7a5631f2398a3d3b219cbef (patch) | |
tree | 958312d1770c6f78c82ccd61f1866d3689e2a2d1 /glamor | |
parent | 32677ce03d793a1f2aa8871112eb3d19b3cb762f (diff) |
glamor/egl: Avoid crashing on broken configurations
0a9415cf apparently can tickle bugs in the GL stack where glGetString
returns NULL, presumably because the eglMakeCurrent() didn't manage to
actually install a dispatch table and you're hitting a stub function.
That's clearly not our bug, but if it happens we should at least not
crash. Notice this case and fail gently.
Signed-off-by: Adam Jackson <ajax@redhat.com>
Diffstat (limited to 'glamor')
-rw-r--r-- | glamor/glamor_egl.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/glamor/glamor_egl.c b/glamor/glamor_egl.c index 9b930d603..210c11824 100644 --- a/glamor/glamor_egl.c +++ b/glamor/glamor_egl.c @@ -995,6 +995,11 @@ glamor_egl_init(ScrnInfoPtr scrn, int fd) } renderer = glGetString(GL_RENDERER); + if (!renderer) { + xf86DrvMsg(scrn->scrnIndex, X_ERROR, + "glGetString() returned NULL, your GL is broken\n"); + goto error; + } if (strstr((const char *)renderer, "llvmpipe")) { xf86DrvMsg(scrn->scrnIndex, X_INFO, "Refusing to try glamor on llvmpipe\n"); |