mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-23 02:05:42 +00:00
Bug 878407 - Allocate a large enough delay buffer when the delay time fraction value is less than 0.5; r=roc
This commit is contained in:
parent
7a83db0a0c
commit
20b20b238c
11
content/media/test/crashtests/878407.html
Normal file
11
content/media/test/crashtests/878407.html
Normal file
@ -0,0 +1,11 @@
|
||||
<script>
|
||||
o1 = new window.AudioContext();
|
||||
o4 = o1.createDelay(0.4468);
|
||||
o6 = o1.createPanner();
|
||||
o7 = (function() {var buf = o1.createBuffer(1, 1000, o1.sampleRate);for(var j=0; j<1; ++j) {for(var i=0; i<1000; ++i) {buf.getChannelData(j)[i] = Math.sin(i * (-15));}}return buf;})();
|
||||
o8 = o1.createBufferSource();
|
||||
o8.buffer = o7;
|
||||
o8.connect(o6);
|
||||
o6.connect(o4)
|
||||
o4.delayTime.setValueAtTime(0.6019893103749466289898, 0.26)
|
||||
</script>
|
@ -33,3 +33,4 @@ load 876252.html
|
||||
load 876834.html
|
||||
load 877820.html
|
||||
load 878014.html
|
||||
load 878407.html
|
||||
|
@ -116,7 +116,7 @@ public:
|
||||
if (!mBuffer.SetLength(aNumberOfChannels)) {
|
||||
return false;
|
||||
}
|
||||
const int32_t numFrames = NS_lround(mMaxDelay * aSampleRate);
|
||||
const int32_t numFrames = ceil(mMaxDelay * aSampleRate);
|
||||
for (uint32_t channel = 0; channel < aNumberOfChannels; ++channel) {
|
||||
if (!mBuffer[channel].SetLength(numFrames)) {
|
||||
return false;
|
||||
|
Loading…
Reference in New Issue
Block a user