1
0
Fork 0

Add checks for auxiliary output channel counts

Apparently this was missing.
This commit is contained in:
Robbert van der Helm 2023-02-26 01:21:31 +01:00
parent 9eaf375f6b
commit 5ed84e5ea4
2 changed files with 10 additions and 0 deletions

View file

@ -2173,6 +2173,7 @@ impl<P: ClapPlugin> Wrapper<P> {
|| process.audio_outputs.is_null() || process.audio_outputs.is_null()
|| (*host_output).data32.is_null() || (*host_output).data32.is_null()
|| buffer.channels() == 0 || 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!(host_output_idx < process.audio_outputs_count as usize);
nih_debug_assert!(!process.audio_outputs.is_null()); nih_debug_assert!(!process.audio_outputs.is_null());
@ -2180,6 +2181,10 @@ impl<P: ClapPlugin> Wrapper<P> {
&& host_output_idx < process.audio_outputs_count as usize && host_output_idx < process.audio_outputs_count as usize
{ {
nih_debug_assert!(!(*host_output).data32.is_null()); 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 // If the host passes weird data then we need to be very sure that there are

View file

@ -1440,11 +1440,16 @@ impl<P: Vst3Plugin> IAudioProcessor for Wrapper<P> {
|| data.outputs.is_null() || data.outputs.is_null()
|| (*host_output).buffers.is_null() || (*host_output).buffers.is_null()
|| buffer.channels() == 0 || 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!(host_output_idx < data.num_outputs as usize);
nih_debug_assert!(!data.outputs.is_null()); nih_debug_assert!(!data.outputs.is_null());
if !data.outputs.is_null() && host_output_idx < data.num_outputs as usize { 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).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 // If the host passes weird data then we need to be very sure that there are