Avoid panics when incorrect buffer sizes are provided to read/write_frames

This commit is contained in:
Ian Hobson
2023-05-12 16:52:06 +02:00
parent 3400778991
commit 3d1826007e
3 changed files with 22 additions and 15 deletions

View File

@@ -41,6 +41,12 @@ pub enum Error {
/// The file is not optimized for writing new data
DataChunkNotPreparedForAppend,
/// A buffer with a length that isn't a multiple of channel_count was provided
InvalidBufferSize {
buffer_size: usize,
channel_count: u16,
},
}
impl StdError for Error {}