From f1a919f4b9bd14998409fbd7a72848e6086e16cd Mon Sep 17 00:00:00 2001 From: Paul Adenot Date: Wed, 13 May 2015 11:02:27 +0200 Subject: [PATCH] Bug 1122218 - Fix off-by-one error when computing oscillator rendering range. r=karlt --- dom/media/test/crashtests/1122218.html | 24 +++++++++++++++++++++++ dom/media/test/crashtests/crashtests.list | 1 + dom/media/webaudio/OscillatorNode.cpp | 2 +- 3 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 dom/media/test/crashtests/1122218.html diff --git a/dom/media/test/crashtests/1122218.html b/dom/media/test/crashtests/1122218.html new file mode 100644 index 00000000000..984487dd218 --- /dev/null +++ b/dom/media/test/crashtests/1122218.html @@ -0,0 +1,24 @@ + + + + + + diff --git a/dom/media/test/crashtests/crashtests.list b/dom/media/test/crashtests/crashtests.list index 36509d9fd78..e15df43c9ef 100644 --- a/dom/media/test/crashtests/crashtests.list +++ b/dom/media/test/crashtests/crashtests.list @@ -77,6 +77,7 @@ 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. diff --git a/dom/media/webaudio/OscillatorNode.cpp b/dom/media/webaudio/OscillatorNode.cpp index 27e3dcbadc4..dc2a664c28e 100644 --- a/dom/media/webaudio/OscillatorNode.cpp +++ b/dom/media/webaudio/OscillatorNode.cpp @@ -303,7 +303,7 @@ public: *aFinished = true; return; } - if (ticks + WEBAUDIO_BLOCK_SIZE < mStart) { + if (ticks + WEBAUDIO_BLOCK_SIZE <= mStart) { // We're not playing yet. ComputeSilence(aOutput); return;