summaryrefslogtreecommitdiffstats
path: root/video
diff options
context:
space:
mode:
authorMartin Herkt <lachs0r@srsfckn.biz>2013-09-19 20:08:34 +0200
committerMartin Herkt <lachs0r@srsfckn.biz>2013-09-19 20:08:34 +0200
commit2115c4a3ad751e887edae29bbf7002d6563fc631 (patch)
treebec234bfb3767e1aa3da98c8cd09de6d1c9f309f /video
parent858dcee5f102fc7273e4ab1665e5230929a3c958 (diff)
downloadmpv-2115c4a3ad751e887edae29bbf7002d6563fc631.tar.bz2
mpv-2115c4a3ad751e887edae29bbf7002d6563fc631.tar.xz
vo/x11_common: Fail init with no valid XIM
XOpenIM can fail to find a valid input method, in which case it returns NULL. Passing a NULL pointer to XCreateIC would cause a crash, so fail VO init before that happens.
Diffstat (limited to 'video')
-rw-r--r--video/out/x11_common.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/video/out/x11_common.c b/video/out/x11_common.c
index 8c6ddae3ea..7c16e253a0 100644
--- a/video/out/x11_common.c
+++ b/video/out/x11_common.c
@@ -479,6 +479,15 @@ int vo_x11_init(struct vo *vo)
}
x11->xim = XOpenIM(x11->display, NULL, NULL, NULL);
+ if (!x11->xim) {
+ MP_MSG(x11, vo->probing ? MSGL_V : MSGL_ERR,
+ "vo: couldn't find a valid X input method!\n");
+
+ XCloseDisplay(x11->display);
+ talloc_free(x11);
+ vo->x11 = NULL;
+ return 0;
+ }
init_atoms(vo->x11);