mirror of
https://github.com/servo/servo.git
synced 2025-06-18 13:24:29 +00:00
Throw when trying to copy AudioBuffer data from or to a SharedArrayBuffer
This commit is contained in:
parent
e80ac0000f
commit
b8ade93538
2 changed files with 12 additions and 4 deletions
|
@ -235,6 +235,10 @@ impl AudioBufferMethods for AudioBuffer {
|
|||
channel_number: u32,
|
||||
start_in_channel: u32,
|
||||
) -> Fallible<()> {
|
||||
if destination.is_shared() {
|
||||
return Err(Error::Type("Cannot copy to shared buffer".to_owned()));
|
||||
}
|
||||
|
||||
if channel_number >= self.number_of_channels || start_in_channel > self.length {
|
||||
return Err(Error::IndexSize);
|
||||
}
|
||||
|
@ -276,6 +280,10 @@ impl AudioBufferMethods for AudioBuffer {
|
|||
channel_number: u32,
|
||||
start_in_channel: u32,
|
||||
) -> Fallible<()> {
|
||||
if source.is_shared() {
|
||||
return Err(Error::Type("Cannot copy from shared buffer".to_owned()));
|
||||
}
|
||||
|
||||
if channel_number >= self.number_of_channels || start_in_channel > (source.len() as u32) {
|
||||
return Err(Error::IndexSize);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue