From 7b0d7f48fbffb412f0c485f86ef33b0dea605d1d Mon Sep 17 00:00:00 2001 From: Jan Grulich Date: Fri, 12 May 2023 20:59:06 +0200 Subject: [PATCH] PipeWire capturer: fix fcntl call when duplicating a file descriptor The fcntl() call has variable arguments, therefore we need to pass 0 to specify there are no other arguments for this call, otherwise we might end up with an argument that is random garbage. Bug: webrtc:15174 Change-Id: I34f16a942d80913b667d8ade7eed557b0233be01 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/305120 Reviewed-by: Alexander Cooper Commit-Queue: Jan Grulich Cr-Commit-Position: refs/heads/main@{#40060} --- .../desktop_capture/linux/wayland/shared_screencast_stream.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/desktop_capture/linux/wayland/shared_screencast_stream.cc b/modules/desktop_capture/linux/wayland/shared_screencast_stream.cc index 58781805f9..b2ad7adea8 100644 --- a/modules/desktop_capture/linux/wayland/shared_screencast_stream.cc +++ b/modules/desktop_capture/linux/wayland/shared_screencast_stream.cc @@ -452,8 +452,8 @@ bool SharedScreenCastStreamPrivate::StartScreenCastStream( PipeWireThreadLoopLock thread_loop_lock(pw_main_loop_); if (fd >= 0) { - pw_core_ = pw_context_connect_fd(pw_context_, fcntl(fd, F_DUPFD_CLOEXEC), - nullptr, 0); + pw_core_ = pw_context_connect_fd( + pw_context_, fcntl(fd, F_DUPFD_CLOEXEC, 0), nullptr, 0); } else { pw_core_ = pw_context_connect(pw_context_, nullptr, 0); }