summaryrefslogtreecommitdiff
path: root/repo/apps/chromium/webrtc-check-existence-of-cursor-metadata.patch
diff options
context:
space:
mode:
Diffstat (limited to 'repo/apps/chromium/webrtc-check-existence-of-cursor-metadata.patch')
-rw-r--r--repo/apps/chromium/webrtc-check-existence-of-cursor-metadata.patch31
1 files changed, 31 insertions, 0 deletions
diff --git a/repo/apps/chromium/webrtc-check-existence-of-cursor-metadata.patch b/repo/apps/chromium/webrtc-check-existence-of-cursor-metadata.patch
new file mode 100644
index 0000000..0c7e731
--- /dev/null
+++ b/repo/apps/chromium/webrtc-check-existence-of-cursor-metadata.patch
@@ -0,0 +1,31 @@
+From c2cd814cdd8cbf8dda6ccec2266327a5321fbde8 Mon Sep 17 00:00:00 2001
+From: Jan Grulich <grulja@gmail.com>
+Date: Tue, 15 Mar 2022 14:31:55 +0100
+Subject: [PATCH] PipeWire capturer: check existence of cursor metadata
+
+Check whether there are any cursor metadata before we try to validate
+and use them, otherwise we might crash on this.
+
+Bug: webrtc:13429
+Change-Id: I365da59a189b6b974cebafc94fec49d5b942efae
+Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/255601
+Reviewed-by: Alexander Cooper <alcooper@chromium.org>
+Commit-Queue: Alexander Cooper <alcooper@chromium.org>
+Cr-Commit-Position: refs/heads/main@{#36240}
+---
+ .../desktop_capture/linux/wayland/shared_screencast_stream.cc | 2 +-
+ 1 file changed, 1 insertion(+), 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 a8c86e26..9e81df4c 100644
+--- a/modules/desktop_capture/linux/wayland/shared_screencast_stream.cc
++++ b/modules/desktop_capture/linux/wayland/shared_screencast_stream.cc
+@@ -650,7 +650,7 @@ void SharedScreenCastStreamPrivate::ProcessBuffer(pw_buffer* buffer) {
+ const struct spa_meta_cursor* cursor =
+ static_cast<struct spa_meta_cursor*>(spa_buffer_find_meta_data(
+ spa_buffer, SPA_META_Cursor, sizeof(*cursor)));
+- if (spa_meta_cursor_is_valid(cursor)) {
++ if (cursor && spa_meta_cursor_is_valid(cursor)) {
+ struct spa_meta_bitmap* bitmap = nullptr;
+
+ if (cursor->bitmap_offset)