mirror of
https://github.com/servo/servo.git
synced 2025-08-05 13:40:08 +01:00
Fix AudioBuffer crash. Do not modify number of channels while moving from shared to js channels
This commit is contained in:
parent
3889041cc6
commit
e80ac0000f
1 changed files with 2 additions and 4 deletions
|
@ -134,8 +134,8 @@ impl AudioBuffer {
|
||||||
|
|
||||||
// Move the channel data from shared_channels to js_channels.
|
// Move the channel data from shared_channels to js_channels.
|
||||||
rooted!(in (cx) let mut array = ptr::null_mut::<JSObject>());
|
rooted!(in (cx) let mut array = ptr::null_mut::<JSObject>());
|
||||||
let shared_channel = (*self.shared_channels.borrow_mut()).buffers.remove(i);
|
let shared_channel = &(*self.shared_channels.borrow_mut()).buffers[i];
|
||||||
if Float32Array::create(cx, CreateWith::Slice(&shared_channel), array.handle_mut())
|
if Float32Array::create(cx, CreateWith::Slice(shared_channel), array.handle_mut())
|
||||||
.is_err()
|
.is_err()
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
|
@ -182,8 +182,6 @@ impl AudioBuffer {
|
||||||
// data into js_channels ArrayBuffers in restore_js_channel_data.
|
// data into js_channels ArrayBuffers in restore_js_channel_data.
|
||||||
}
|
}
|
||||||
|
|
||||||
self.js_channels.borrow_mut().clear();
|
|
||||||
|
|
||||||
Some((*self.shared_channels.borrow()).clone())
|
Some((*self.shared_channels.borrow()).clone())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue