Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix all AudioBuffer WPTs #21602

Merged
merged 10 commits into from Sep 19, 2018
Next

Fix AudioBuffer crash. Do not modify number of channels while moving …

…from shared to js channels
  • Loading branch information
ferjm committed Sep 19, 2018
commit e80ac0000f6826568d526810373b4f59aeebeb27
@@ -134,8 +134,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;
@@ -182,8 +182,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())
}
}
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.