summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2019-11-08 18:56:57 +0100
committerwm4 <wm4@nowhere>2019-11-08 21:22:49 +0100
commitcd8fd4b7886e65e89e29c309bf5145bc31c909ab (patch)
tree42ac8b7d7d6b6b12aa13ae1d7425e1c688ace632
parentbcfabf40a4819f82b37c83d0fb969a25454aa828 (diff)
downloadmpv-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).
-rw-r--r--video/out/opengl/context_x11egl.c5
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);