Skip to content

Commit

Permalink
Auto merge of #21602 - ferjm:audiobuffer.crash, r=<try>
Browse files Browse the repository at this point in the history
Fix AudioBuffer crash

- [X] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [X] There are tests for these changes

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/21602)
<!-- Reviewable:end -->
  • Loading branch information
bors-servo committed Sep 6, 2018
2 parents af777fc + a03de5d commit 743a15b
Show file tree
Hide file tree
Showing 7 changed files with 54 additions and 9 deletions.
6 changes: 2 additions & 4 deletions components/script/dom/audiobuffer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,8 @@ impl AudioBuffer {

// Move the channel data from shared_channels to js_channels.
rooted!(in (cx) let mut array = ptr::null_mut::<JSObject>());
let shared_channel = (*self.shared_channels.borrow_mut()).buffers.remove(i);
if Float32Array::create(cx, CreateWith::Slice(&shared_channel), array.handle_mut())
let shared_channel = &(*self.shared_channels.borrow_mut()).buffers[i];
if Float32Array::create(cx, CreateWith::Slice(shared_channel), array.handle_mut())
.is_err()
{
return false;
Expand Down Expand Up @@ -183,8 +183,6 @@ impl AudioBuffer {
// data into js_channels ArrayBuffers in restore_js_channel_data.
}

self.js_channels.borrow_mut().clear();

Some((*self.shared_channels.borrow()).clone())
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1,10 @@
[audiobuffersource-playbackrate-zero.html]
expected: CRASH
[< [synthesize-verify\] 1 out of 1 assertions were failed.]
expected: FAIL

[X The zero playbackRate should hold the sample value. Expected 0.5 but got 0.5001220703125 at the index 4097 Got false.]
expected: FAIL

[# AUDIT TASK RUNNER FINISHED: 1 out of 1 tasks were failed.]
expected: FAIL

Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,6 @@
[# AUDIT TASK RUNNER FINISHED: 1 out of 1 tasks were failed.]
expected: FAIL

[< [Tests AudioBufferSourceNode start()\] 6 out of 18 assertions were failed.]
expected: FAIL

Original file line number Diff line number Diff line change
@@ -1,2 +1,22 @@
[note-grain-on-play.html]
expected: CRASH
[X Number of grains that started at the correct time is not equal to 100. Got 1.]
expected: FAIL

[X Pulse 0 boundary expected to be equal to the array [0,441\] but differs in 1 places:\n\tIndex\tActual\t\t\tExpected\n\t[1\]\t4.8520000000000000e+3\t4.4100000000000000e+2]
expected: FAIL

[X Number of start frames is not equal to 100. Got 1.]
expected: FAIL

[X Number of grains out of 100 that ended at the wrong time is not equal to 0. Got 1.]
expected: FAIL

[< [note-grain-on-play\] 5 out of 8 assertions were failed.]
expected: FAIL

[X Number of end frames is not equal to 100. Got 1.]
expected: FAIL

[# AUDIT TASK RUNNER FINISHED: 1 out of 1 tasks were failed.]
expected: FAIL

Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
[audionode-channel-rules.html]
expected: CRASH
expected: TIMEOUT
Original file line number Diff line number Diff line change
@@ -1,2 +1,10 @@
[audioparam-connect-audioratesignal.html]
expected: CRASH
[# AUDIT TASK RUNNER FINISHED: 1 out of 1 tasks were failed.]
expected: FAIL

[X Rendered signal exactly matches the audio-rate gain changing signal is not true. Got false.]
expected: FAIL

[< [test\] 1 out of 2 assertions were failed.]
expected: FAIL

Original file line number Diff line number Diff line change
@@ -1,2 +1,10 @@
[audioparam-summingjunction.html]
expected: CRASH
[# AUDIT TASK RUNNER FINISHED: 1 out of 1 tasks were failed.]
expected: FAIL

[X Rendered signal matches sum of two audio-rate gain changing signals plus baseline gain is not true. Got false.]
expected: FAIL

[< [test\] 1 out of 2 assertions were failed.]
expected: FAIL

0 comments on commit 743a15b

Please sign in to comment.