diff --git a/CHANGELOG.md b/CHANGELOG.md index b389ee87..9224241c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,13 @@ Since there is no stable release yet, the changes are organized per day in reverse chronological order. The main purpose of this document in its current state is to list breaking changes. +## [2023-05-21] + +### Fixed + +- Fixed null pointers assertions in the low level buffer management code not + working correctly. + ## [2023-09-03] ### Added diff --git a/src/wrapper/util/buffer_management.rs b/src/wrapper/util/buffer_management.rs index 98777d7a..763982ca 100644 --- a/src/wrapper/util/buffer_management.rs +++ b/src/wrapper/util/buffer_management.rs @@ -191,9 +191,9 @@ impl BufferManager { .enumerate() .take(output_channel_pointers.num_channels) { + assert!(!output_channel_pointers.ptrs.as_ptr().is_null()); let output_channel_pointer = output_channel_pointers.ptrs.as_ptr().add(channel_idx); - assert!(!output_channel_pointer.is_null()); *output_slice = std::slice::from_raw_parts_mut( (*output_channel_pointer).add(sample_offset), @@ -229,9 +229,9 @@ impl BufferManager { .enumerate() .take(input_channel_pointers.num_channels) { + assert!(!input_channel_pointers.ptrs.as_ptr().is_null()); let input_channel_pointer = input_channel_pointers.ptrs.as_ptr().add(channel_idx); - assert!(!input_channel_pointer.is_null()); output_slice.copy_from_slice(std::slice::from_raw_parts_mut( (*input_channel_pointer).add(sample_offset), @@ -273,9 +273,9 @@ impl BufferManager { .enumerate() .take(input_channel_pointers.num_channels) { + assert!(!input_channel_pointers.ptrs.as_ptr().is_null()); let input_channel_pointer = input_channel_pointers.ptrs.as_ptr().add(channel_idx); - assert!(!input_channel_pointer.is_null()); nih_debug_assert!(num_samples <= channel.capacity()); channel.resize(num_samples, 0.0); @@ -334,9 +334,9 @@ impl BufferManager { .enumerate() .take(output_channel_pointers.num_channels) { + assert!(!output_channel_pointers.ptrs.as_ptr().is_null()); let output_channel_pointer = output_channel_pointers.ptrs.as_ptr().add(channel_idx); - assert!(!output_channel_pointer.is_null()); *output_slice = std::slice::from_raw_parts_mut( (*output_channel_pointer).add(sample_offset),