diff options
author | wm4 <wm4@nowhere> | 2014-05-26 21:53:20 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2014-05-26 21:59:30 +0200 |
commit | 44e8a4085e74675598635089677c47524348d75f (patch) | |
tree | b3af9b86b790f263c9e1691fa27fffee6478c5f2 | |
parent | 6710527a832a253439cb31862bd568380f41efec (diff) | |
download | mpv-44e8a4085e74675598635089677c47524348d75f.tar.bz2 mpv-44e8a4085e74675598635089677c47524348d75f.tar.xz |
x11: fix datatype for _NET_WM_PID
Setting this property was added 12 years ago, and the code was always
incorrect. The underlying data type is "long", not "pid_t". It's well
possible that the data types are different, and the pointer to the pid
variable is directly passed to XChangeProperty, possibly invoking
undefined behavior.
It's funny, because in theory using pid_t for PIDs sounds more correct.
-rw-r--r-- | video/out/x11_common.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/video/out/x11_common.c b/video/out/x11_common.c index 5d2a5b1fec..37855efa4e 100644 --- a/video/out/x11_common.c +++ b/video/out/x11_common.c @@ -573,7 +573,7 @@ static void vo_x11_classhint(struct vo *vo, Window window, const char *name) struct mp_vo_opts *opts = vo->opts; struct vo_x11_state *x11 = vo->x11; XClassHint wmClass; - pid_t pid = getpid(); + long pid = getpid(); wmClass.res_name = opts->winname ? opts->winname : (char *)name; wmClass.res_class = "mpv"; |