summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-05-26 21:53:20 +0200
committerwm4 <wm4@nowhere>2014-06-14 13:50:02 +0200
commit2f86a06528ab971822a1c8b9a217ee1f29f50d71 (patch)
treee9fa1395fc98c5b8c0daf6469999ace1251d7896
parent7e61bf134a30c0154ca2d0cf841cc38e79e4f167 (diff)
downloadmpv-2f86a06528ab971822a1c8b9a217ee1f29f50d71.tar.bz2
mpv-2f86a06528ab971822a1c8b9a217ee1f29f50d71.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.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/video/out/x11_common.c b/video/out/x11_common.c
index 07d3713f5d..7403c0d892 100644
--- a/video/out/x11_common.c
+++ b/video/out/x11_common.c
@@ -668,7 +668,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";