mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
chore: cherry-pick d18460a2 from chromium (#42641)
* chore: cherry-pick d18460a2 from chromium * chore: update patches --------- Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
This commit is contained in:
@@ -148,3 +148,4 @@ cherry-pick-b922fcb61e3b.patch
|
||||
cherry-pick-0d9598145069.patch
|
||||
cherry-pick-24329fe5c4d0.patch
|
||||
m120-lts_mediasession_use_a_mediasessionimpl_weakptr_in.patch
|
||||
x11_fix_crash_when_randr_getmonitors_fails.patch
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Tom Anderson <thomasanderson@chromium.org>
|
||||
Date: Tue, 27 Feb 2024 00:35:14 +0000
|
||||
Subject: Fix crash when RandR::GetMonitors fails
|
||||
|
||||
R=sky
|
||||
|
||||
Change-Id: Id3c01221cec6edb4b782a273653758c1375c0acb
|
||||
Fixed: 326328413
|
||||
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5324886
|
||||
Commit-Queue: Scott Violet <sky@chromium.org>
|
||||
Reviewed-by: Scott Violet <sky@chromium.org>
|
||||
Auto-Submit: Thomas Anderson <thomasanderson@chromium.org>
|
||||
Commit-Queue: Thomas Anderson <thomasanderson@chromium.org>
|
||||
Cr-Commit-Position: refs/heads/main@{#1265556}
|
||||
|
||||
diff --git a/ui/base/x/x11_display_util.cc b/ui/base/x/x11_display_util.cc
|
||||
index bf3077d80fc0ce31f381d5ff1defef16cfdbee0a..fda1c3cb239210ac7efbf0aa2311548d0142c413 100644
|
||||
--- a/ui/base/x/x11_display_util.cc
|
||||
+++ b/ui/base/x/x11_display_util.cc
|
||||
@@ -44,6 +44,9 @@ constexpr const char kRandrEdidProperty[] = "EDID";
|
||||
std::map<x11::RandR::Output, size_t> GetMonitors(
|
||||
const x11::Response<x11::RandR::GetMonitorsReply>& reply) {
|
||||
std::map<x11::RandR::Output, size_t> output_to_monitor;
|
||||
+ if (!reply) {
|
||||
+ return output_to_monitor;
|
||||
+ }
|
||||
for (size_t monitor = 0; monitor < reply->monitors.size(); monitor++) {
|
||||
for (x11::RandR::Output output : reply->monitors[monitor].outputs) {
|
||||
output_to_monitor[output] = monitor;
|
||||
Reference in New Issue
Block a user