mirror of
https://github.com/mpv-player/mpv
synced 2025-03-30 07:18:17 +00:00
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.
This commit is contained in:
parent
858dcee5f1
commit
2115c4a3ad
@ -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);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user