diff options
author | wm4 <wm4@nowhere> | 2019-11-08 18:56:57 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2019-11-08 21:22:49 +0100 |
commit | cd8fd4b7886e65e89e29c309bf5145bc31c909ab (patch) | |
tree | 42ac8b7d7d6b6b12aa13ae1d7425e1c688ace632 /video/out | |
parent | bcfabf40a4819f82b37c83d0fb969a25454aa828 (diff) | |
download | mpv-cd8fd4b7886e65e89e29c309bf5145bc31c909ab.tar.bz2 mpv-cd8fd4b7886e65e89e29c309bf5145bc31c909ab.tar.xz |
vo_gpu: context_x11egl: check eglGetConfigAttrib() for errors
Not sure why it assumes that it always succeeds (although generally it
won't fail).
Diffstat (limited to 'video/out')
-rw-r--r-- | video/out/opengl/context_x11egl.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/video/out/opengl/context_x11egl.c b/video/out/opengl/context_x11egl.c index b1aa0690d7..f0cfe378f1 100644 --- a/video/out/opengl/context_x11egl.c +++ b/video/out/opengl/context_x11egl.c @@ -125,7 +125,10 @@ static bool mpegl_init(struct ra_ctx *ctx) goto uninit; int vID, n; - eglGetConfigAttrib(p->egl_display, config, EGL_NATIVE_VISUAL_ID, &vID); + if (!eglGetConfigAttrib(p->egl_display, config, EGL_NATIVE_VISUAL_ID, &vID)) { + MP_FATAL(ctx, "Getting X visual ID failed!\n"); + goto uninit; + } MP_VERBOSE(ctx, "chose visual 0x%x\n", vID); XVisualInfo template = {.visualid = vID}; XVisualInfo *vi = XGetVisualInfo(vo->x11->display, VisualIDMask, &template, &n); |