We cherry-picked this in bug 2040112. Upstream commit: https://webrtc.googlesource.com/src/+/7ff59ed9c9d1c7f9126225d30e7a72d80ab3ab4d Wayland capture: Fix integer overflow in cursor bitmap validation Use 64-bit arithmetic for the cursor bitmap bounds check to avoid incorrect results with large values. Bug: chromium:513054275 Change-Id: I9ad3e6e7179223f0f8f548451be3a0e2d6248b9e Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/472660 Reviewed-by: Alexander Cooper <alcooper@chromium.org> Commit-Queue: Mark Foltz <mfoltz@chromium.org> Reviewed-by: Mark Foltz <mfoltz@chromium.org> Cr-Commit-Position: refs/heads/main@{#47716}
39 lines
1.5 KiB
Diff
39 lines
1.5 KiB
Diff
From: stransky <stransky@redhat.com>
|
|
Date: Tue, 29 Aug 2023 12:43:00 +0000
|
|
Subject: Bug 1821629 [DMABuf] Don't use DMABuf if it's disabled by Firefox gfx
|
|
config r=ng,webrtc-reviewers
|
|
|
|
Differential Revision: https://phabricator.services.mozilla.com/D172224
|
|
Mercurial Revision: https://hg.mozilla.org/mozilla-central/rev/158a888cad8869a2f0026fa7cfaaa13ecbfcf2ed
|
|
---
|
|
.../linux/wayland/shared_screencast_stream.cc | 9 ++++++++-
|
|
1 file changed, 8 insertions(+), 1 deletion(-)
|
|
|
|
diff --git a/modules/desktop_capture/linux/wayland/shared_screencast_stream.cc b/modules/desktop_capture/linux/wayland/shared_screencast_stream.cc
|
|
index 7366fd5b73..5e6a22175f 100644
|
|
--- a/modules/desktop_capture/linux/wayland/shared_screencast_stream.cc
|
|
+++ b/modules/desktop_capture/linux/wayland/shared_screencast_stream.cc
|
|
@@ -60,6 +60,13 @@
|
|
#include "rtc_base/thread_annotations.h"
|
|
#include "rtc_base/time_utils.h"
|
|
|
|
+// Wrapper for gfxVars::UseDMABuf() as we can't include gfxVars here.
|
|
+// We don't want to use dmabuf of known broken systems.
|
|
+// See FEATURE_DMABUF for details.
|
|
+namespace mozilla::gfx {
|
|
+bool IsDMABufEnabled();
|
|
+}
|
|
+
|
|
namespace webrtc {
|
|
|
|
constexpr int kBytesPerPixel = 4;
|
|
@@ -355,7 +362,7 @@ void SharedScreenCastStreamPrivate::OnStreamParamChanged(
|
|
RTC_LOG(LS_INFO) << sb.str();
|
|
}
|
|
|
|
- const int buffer_types = has_modifier
|
|
+ const int buffer_types = has_modifier && mozilla::gfx::IsDMABufEnabled()
|
|
? (1 << SPA_DATA_DmaBuf) | (1 << SPA_DATA_MemFd)
|
|
: (1 << SPA_DATA_MemFd);
|
|
|