fix: crash on source capture with empty thumbnail size (#47651)

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
This commit is contained in:
trop[bot] 2025-07-03 19:19:12 +02:00 committed by GitHub
parent 729ceb4360
commit ceefcd1d32
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -233,7 +233,8 @@ DesktopCapturer::DesktopListListener::~DesktopListListener() = default;
void DesktopCapturer::DesktopListListener::OnDelegatedSourceListSelection() {
if (have_thumbnail_) {
std::move(update_callback_).Run();
content::GetUIThreadTaskRunner({})->PostTask(FROM_HERE,
std::move(update_callback_));
} else {
have_selection_ = true;
}
@ -246,7 +247,8 @@ void DesktopCapturer::DesktopListListener::OnSourceThumbnailChanged(int index) {
have_selection_ = false;
// PipeWire returns a single source, so index is not relevant.
std::move(update_callback_).Run();
content::GetUIThreadTaskRunner({})->PostTask(FROM_HERE,
std::move(update_callback_));
} else {
have_thumbnail_ = true;
}