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

Unified Diff: third_party/WebKit/Source/modules/webaudio/AudioParamTimeline.cpp

Issue 2020753002: Throw exception if curve is too short for setValueCurveAtTime (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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
Index: third_party/WebKit/Source/modules/webaudio/AudioParamTimeline.cpp
diff --git a/third_party/WebKit/Source/modules/webaudio/AudioParamTimeline.cpp b/third_party/WebKit/Source/modules/webaudio/AudioParamTimeline.cpp
index 54068c6a3b81c2422a1e44129231095271c94822..3377641725c26da5f02ad2dbaf012b55b932556e 100644
--- a/third_party/WebKit/Source/modules/webaudio/AudioParamTimeline.cpp
+++ b/third_party/WebKit/Source/modules/webaudio/AudioParamTimeline.cpp
@@ -194,6 +194,16 @@ void AudioParamTimeline::setValueCurveAtTime(DOMFloat32Array* curve, double time
|| !isPositiveAudioParamTime(duration, exceptionState, "Duration"))
return;
+ if (curve->length() < 2) {
+ exceptionState.throwDOMException(
+ InvalidStateError,
+ ExceptionMessages::indexExceedsMinimumBound(
+ "curve length",
+ curve->length(),
+ 2U));
+ return;
+ }
+
insertEvent(ParamEvent::createSetValueCurveEvent(curve, time, duration), exceptionState);
}

Powered by Google App Engine
This is Rietveld 408576698