diff --git a/src/wrapper/clap/wrapper.rs b/src/wrapper/clap/wrapper.rs index db158333..485639bc 100644 --- a/src/wrapper/clap/wrapper.rs +++ b/src/wrapper/clap/wrapper.rs @@ -2119,9 +2119,16 @@ impl Wrapper

{ { nih_debug_assert!(host_input_idx < process.audio_inputs_count as usize); nih_debug_assert!(!process.audio_inputs.is_null()); - nih_debug_assert!(!(*host_input).data32.is_null()); nih_debug_assert!(!storage.is_empty()); - nih_debug_assert_eq!((*host_input).channel_count, buffer.channels() as u32); + if !process.audio_inputs.is_null() + && host_input_idx < process.audio_inputs_count as usize + { + nih_debug_assert!(!(*host_input).data32.is_null()); + nih_debug_assert_eq!( + (*host_input).channel_count, + buffer.channels() as u32 + ); + } // If the host passes weird data then we need to be very sure that there are // no dangling references to previous data @@ -2169,7 +2176,11 @@ impl Wrapper

{ { nih_debug_assert!(host_output_idx < process.audio_outputs_count as usize); nih_debug_assert!(!process.audio_outputs.is_null()); - nih_debug_assert!(!(*host_output).data32.is_null()); + if !process.audio_outputs.is_null() + && host_output_idx < process.audio_outputs_count as usize + { + nih_debug_assert!(!(*host_output).data32.is_null()); + } // If the host passes weird data then we need to be very sure that there are // no dangling references to previous data diff --git a/src/wrapper/vst3/wrapper.rs b/src/wrapper/vst3/wrapper.rs index 8110454d..2ebe39f6 100644 --- a/src/wrapper/vst3/wrapper.rs +++ b/src/wrapper/vst3/wrapper.rs @@ -1383,9 +1383,14 @@ impl IAudioProcessor for Wrapper

{ { nih_debug_assert!(host_input_idx < data.num_inputs as usize); nih_debug_assert!(!data.inputs.is_null()); - nih_debug_assert!(!(*host_input).buffers.is_null()); nih_debug_assert!(!storage.is_empty()); - nih_debug_assert_eq!((*host_input).num_channels, buffer.channels() as i32); + if !data.inputs.is_null() && host_input_idx < data.num_inputs as usize { + nih_debug_assert!(!(*host_input).buffers.is_null()); + nih_debug_assert_eq!( + (*host_input).num_channels, + buffer.channels() as i32 + ); + } // If the host passes weird data then we need to be very sure that there are // no dangling references to previous data @@ -1434,7 +1439,9 @@ impl IAudioProcessor for Wrapper

{ { nih_debug_assert!(host_output_idx < data.num_outputs as usize); nih_debug_assert!(!data.outputs.is_null()); - nih_debug_assert!(!(*host_output).buffers.is_null()); + if !data.outputs.is_null() && host_output_idx < data.num_outputs as usize { + nih_debug_assert!(!(*host_output).buffers.is_null()); + } // If the host passes weird data then we need to be very sure that there are // no dangling references to previous data