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

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

Issue 27039002: Fix crash when the OfflineAudioContext constructor is given 0 as numberOfFrames (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix nits Created 7 years, 2 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 | « Source/modules/webaudio/AudioContext.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/modules/webaudio/OfflineAudioContext.cpp
diff --git a/Source/modules/webaudio/OfflineAudioContext.cpp b/Source/modules/webaudio/OfflineAudioContext.cpp
index 832a57aed982813af53ac1a6141df488242c6c62..5a2860af5ae391a4e212f5be7ef128540a1e5334 100644
--- a/Source/modules/webaudio/OfflineAudioContext.cpp
+++ b/Source/modules/webaudio/OfflineAudioContext.cpp
@@ -48,6 +48,15 @@ PassRefPtr<OfflineAudioContext> OfflineAudioContext::create(ExecutionContext* co
Document* document = toDocument(context);
+ if (!numberOfFrames) {
+ es.throwDOMException(
+ SyntaxError,
+ ExceptionMessages::failedToConstruct(
+ "OfflineAudioContext",
+ "number of frames cannot be zero."));
+ return 0;
+ }
+
if (numberOfChannels > 10) {
es.throwDOMException(
SyntaxError,
« no previous file with comments | « Source/modules/webaudio/AudioContext.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698