Throw IndexError if start_in_channel is equal to ArrayBuffer length

This commit is contained in:
Fernando Jiménez Moreno 2018-09-18 16:45:35 +02:00
parent 10e8ab3892
commit a81389268a

View file

@ -227,7 +227,7 @@ impl AudioBufferMethods for AudioBuffer {
return Err(Error::Type("Cannot copy to shared buffer".to_owned()));
}
if channel_number >= self.number_of_channels || start_in_channel > self.length {
if channel_number >= self.number_of_channels || start_in_channel >= self.length {
return Err(Error::IndexSize);
}