Skip to content
This repository was archived by the owner on Jul 9, 2025. It is now read-only.

Commit bf1c6a0

Browse files
committed
Bug 1594794 - NULL Crash in MediaKeySystemAccessManager::CheckDoesWindowSupportProtectedMedia r=bryce,bzbarsky
This change fixes a crash when there is no BrowserChild available (i.e., e10s is is turned off in Windows). In this case, the window is assumed to support protected media and will proceed without making the IPC call to check. Differential Revision: https://phabricator.services.mozilla.com/D52190 --HG-- extra : moz-landing-system : lando
1 parent 7c774ed commit bf1c6a0

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

dom/media/eme/MediaKeySystemAccessManager.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,16 @@ void MediaKeySystemAccessManager::CheckDoesWindowSupportProtectedMedia(
132132
// On other platforms windows should always support protected media.
133133
#ifdef XP_WIN
134134
RefPtr<BrowserChild> browser(BrowserChild::GetFrom(mWindow));
135+
if (!browser) {
136+
if (!XRE_IsParentProcess() || XRE_IsE10sParentProcess()) {
137+
MOZ_CRASH("BrowserChild should only be unavailable with e10s off");
138+
}
139+
140+
MKSAM_LOG_DEBUG("Allowing protected media on Windows with e10s off.");
141+
142+
OnDoesWindowSupportProtectedMedia(true, std::move(aRequest));
143+
return;
144+
}
135145

136146
RefPtr<MediaKeySystemAccessManager> self(this);
137147

@@ -156,6 +166,7 @@ void MediaKeySystemAccessManager::CheckDoesWindowSupportProtectedMedia(
156166
self->OnDoesWindowSupportProtectedMedia(false, std::move(request));
157167
}
158168
});
169+
159170
#else
160171
// Non-Windows OS windows always support protected media.
161172
MKSAM_LOG_DEBUG(

0 commit comments

Comments
 (0)