Bug 1122218 - Fix off-by-one error when computing oscillator rendering range. r=karlt
authorPaul Adenot <paul@paul.cx>
Wed, 13 May 2015 11:02:27 +0200
changeset 243661 c48d5ce78376f7e19afc4702c7940db2f0838726
parent 243660 2e7ce565cfc4df4aba77fe0de31893c524a96ca7
child 243662 fceaf20d128cb3b73eba8bbc31e56c497031710d
push id28744
push userkwierso@gmail.com
push dateWed, 13 May 2015 18:12:16 +0000
treeherdermozilla-central@324c3423deaf [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskarlt
bugs1122218
milestone41.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1122218 - Fix off-by-one error when computing oscillator rendering range. r=karlt
dom/media/test/crashtests/1122218.html
dom/media/test/crashtests/crashtests.list
dom/media/webaudio/OscillatorNode.cpp
new file mode 100644
--- /dev/null
+++ b/dom/media/test/crashtests/1122218.html
@@ -0,0 +1,24 @@
+<html>
+<head>
+<script>
+function boom() {
+  var r0=new AudioContext();
+
+  var cm=r0.createChannelMerger(20);
+
+  var o1=r0.createOscillator();
+  var o2=r0.createOscillator();
+
+  var pw=r0.createPeriodicWave(new Float32Array(4),new Float32Array(4));
+  o2.setPeriodicWave(pw);
+
+  o1.connect(cm);
+  cm.connect(o2.frequency);
+
+  o1.start();
+  o2.start(0.476);
+}
+</script>
+</head>
+<body onload="boom();"></body>
+</html>
--- a/dom/media/test/crashtests/crashtests.list
+++ b/dom/media/test/crashtests/crashtests.list
@@ -72,12 +72,13 @@ skip-if(Android||B2G) test-pref(media.na
 load buffer-source-ended-1.html
 HTTP load media-element-source-seek-1.html
 load offline-buffer-source-ended-1.html
 load oscillator-ended-1.html
 load oscillator-ended-2.html
 load 1080986.html
 load 1158427.html
 load 1157994.html
+load 1122218.html
 include ../../mediasource/test/crashtests/crashtests.list
 
 # This needs to run at the end to avoid leaking busted state into other tests.
 skip-if(B2G||winWidget||OSX==1006||OSX==1010&&isDebugBuild) load 691096-1.html
--- a/dom/media/webaudio/OscillatorNode.cpp
+++ b/dom/media/webaudio/OscillatorNode.cpp
@@ -298,17 +298,17 @@ public:
     }
 
     if (ticks >= mStop) {
       // We've finished playing.
       ComputeSilence(aOutput);
       *aFinished = true;
       return;
     }
-    if (ticks + WEBAUDIO_BLOCK_SIZE < mStart) {
+    if (ticks + WEBAUDIO_BLOCK_SIZE <= mStart) {
       // We're not playing yet.
       ComputeSilence(aOutput);
       return;
     }
 
     AllocateAudioBlock(1, aOutput);
     float* output = static_cast<float*>(
         const_cast<void*>(aOutput->mChannelData[0]));