1
0
mirror of https://github.com/mpv-player/mpv synced 2024-12-12 18:06:18 +00:00

x11: fix VOCTRL_GET_WIN_STATE

Do not rely on the pointed-to argument to be initialized; VOCTRLs are
supposed to completely overwrite them on success (or not to touch them
on failure).

The currently only caller of VOCTRL_GET_WIN_STATE initializes the value
before calling this, so this is merely about correctness and didn't lead
to any actual bugs.
This commit is contained in:
wm4 2015-03-09 11:46:16 +01:00
parent a26ea50694
commit b7f242dfcf

View File

@ -1675,6 +1675,7 @@ int vo_x11_control(struct vo *vo, int *events, int request, void *arg)
case VOCTRL_GET_WIN_STATE: {
if (!x11->pseudo_mapped)
return VO_FALSE;
*(int *)arg = 0;
int num_elems;
long *elems = x11_get_property(x11, x11->window, XA(x11, _NET_WM_STATE),
XA_ATOM, 32, &num_elems);