mirror of
https://github.com/robbert-vdh/nih-plug.git
synced 2026-07-01 02:36:54 +00:00
Fix null pointer assertions in buffer management
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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),
|
||||
|
||||
Reference in New Issue
Block a user