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

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

Issue 138943003: Check for NaN when creating a DelayNode for WebAudio (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 11 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/DelayDSPKernel.cpp ('k') | Source/platform/audio/AudioDelayDSPKernel.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/modules/webaudio/DelayNode.cpp
diff --git a/Source/modules/webaudio/DelayNode.cpp b/Source/modules/webaudio/DelayNode.cpp
index 7a8817ee82e2d07530da46c9d099f1a9018e4666..55c6337635ea244d45bc023756630af9aa65ba7b 100644
--- a/Source/modules/webaudio/DelayNode.cpp
+++ b/Source/modules/webaudio/DelayNode.cpp
@@ -31,6 +31,7 @@
#include "bindings/v8/ExceptionMessages.h"
#include "bindings/v8/ExceptionState.h"
#include "core/dom/ExceptionCode.h"
+#include "wtf/MathExtras.h"
namespace WebCore {
@@ -40,7 +41,7 @@ DelayNode::DelayNode(AudioContext* context, float sampleRate, double maxDelayTim
: AudioBasicProcessorNode(context, sampleRate)
{
ScriptWrappable::init(this);
- if (maxDelayTime <= 0 || maxDelayTime >= maximumAllowedDelayTime) {
+ if (maxDelayTime <= 0 || maxDelayTime >= maximumAllowedDelayTime || std::isnan(maxDelayTime)) {
exceptionState.throwDOMException(
NotSupportedError,
"max delay time (" + String::number(maxDelayTime)
« no previous file with comments | « Source/modules/webaudio/DelayDSPKernel.cpp ('k') | Source/platform/audio/AudioDelayDSPKernel.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698