Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1167)

Unified Diff: Source/modules/webaudio/MediaElementAudioSourceNode.cpp

Issue 905393002: Check for valid webMediaPlayer() before using it. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « LayoutTests/http/tests/security/media-element-audio-source-node-same-origin-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/modules/webaudio/MediaElementAudioSourceNode.cpp
diff --git a/Source/modules/webaudio/MediaElementAudioSourceNode.cpp b/Source/modules/webaudio/MediaElementAudioSourceNode.cpp
index 92c558cb5a03d6ed632ea4fb075c9878357ae5d9..453bfa22a3be2e2f2b9226b3269520d81c00236d 100644
--- a/Source/modules/webaudio/MediaElementAudioSourceNode.cpp
+++ b/Source/modules/webaudio/MediaElementAudioSourceNode.cpp
@@ -129,6 +129,11 @@ void MediaElementAudioSourceNode::process(size_t numberOfFrames)
ASSERT(m_sourceSampleRate == sampleRate());
provider->provideInput(outputBus, numberOfFrames);
}
+ // Output silence if we don't have access to the element.
+ if (!((mediaElement()->webMediaPlayer() && mediaElement()->webMediaPlayer()->didPassCORSAccessCheck())
+ || context()->securityOrigin()->canRequest(mediaElement()->currentSrc()))) {
+ outputBus->zero();
+ }
} else {
// Either this port doesn't yet support HTMLMediaElement audio stream access,
// or the stream is not yet available.
« no previous file with comments | « LayoutTests/http/tests/security/media-element-audio-source-node-same-origin-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698