diff --git a/src/wrapper/clap/wrapper.rs b/src/wrapper/clap/wrapper.rs index 485639bc..2dd49043 100644 --- a/src/wrapper/clap/wrapper.rs +++ b/src/wrapper/clap/wrapper.rs @@ -2173,6 +2173,7 @@ impl Wrapper

{ || process.audio_outputs.is_null() || (*host_output).data32.is_null() || buffer.channels() == 0 + || (*host_output).channel_count != buffer.channels() as u32 { nih_debug_assert!(host_output_idx < process.audio_outputs_count as usize); nih_debug_assert!(!process.audio_outputs.is_null()); @@ -2180,6 +2181,10 @@ impl Wrapper

{ && host_output_idx < process.audio_outputs_count as usize { nih_debug_assert!(!(*host_output).data32.is_null()); + nih_debug_assert_eq!( + !(*host_output).channel_count, + buffer.channels() as u32 + ); } // If the host passes weird data then we need to be very sure that there are diff --git a/src/wrapper/vst3/wrapper.rs b/src/wrapper/vst3/wrapper.rs index cecae56e..3a15f8ae 100644 --- a/src/wrapper/vst3/wrapper.rs +++ b/src/wrapper/vst3/wrapper.rs @@ -1440,11 +1440,16 @@ impl IAudioProcessor for Wrapper

{ || data.outputs.is_null() || (*host_output).buffers.is_null() || buffer.channels() == 0 + || (*host_output).num_channels != buffer.channels() as i32 { nih_debug_assert!(host_output_idx < data.num_outputs as usize); nih_debug_assert!(!data.outputs.is_null()); if !data.outputs.is_null() && host_output_idx < data.num_outputs as usize { nih_debug_assert!(!(*host_output).buffers.is_null()); + nih_debug_assert!( + !(*host_output).num_channels == 0 + || !(*host_output).num_channels == buffer.channels() as i32 + ); } // If the host passes weird data then we need to be very sure that there are