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

Throw when trying to copy AudioBuffer data from or to a SharedArrayBu…

…ffer
  • Loading branch information
ferjm committed Sep 19, 2018
commit b8ade9353894e339781f99f725edab02359c10b5

Some generated files are not rendered by default. Learn more.

@@ -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);
}
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.