From 630a835636764d9ec4bfbc70269b0a99011b762d Mon Sep 17 00:00:00 2001 From: Benjamin Klum Date: Sun, 27 Aug 2023 14:56:12 +0200 Subject: [PATCH] Prevent potential hard crash in process_f64 call --- .../infrastructure/plugin/realearn_plugin.rs | 24 ++++++++++--------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/main/src/infrastructure/plugin/realearn_plugin.rs b/main/src/infrastructure/plugin/realearn_plugin.rs index 54778703f..eba55af8c 100644 --- a/main/src/infrastructure/plugin/realearn_plugin.rs +++ b/main/src/infrastructure/plugin/realearn_plugin.rs @@ -304,17 +304,19 @@ impl Plugin for RealearnPlugin { fn process_f64(&mut self, buffer: &mut AudioBuffer) { #[cfg(not(feature = "playtime"))] let _ = buffer; - assert_no_alloc(|| { - // Get current time information so we can detect changes in play state reliably - // (TimeInfoFlags::TRANSPORT_CHANGED doesn't work the way we want it). - self.was_playing_in_last_cycle = self.is_now_playing(); - self.real_time_processor.lock_recover().run_from_vst( - #[cfg(feature = "playtime")] - buffer, - #[cfg(feature = "playtime")] - crate::domain::AudioBlockProps::from_vst(buffer, self.sample_rate), - &self.host, - ); + firewall(|| { + assert_no_alloc(|| { + // Get current time information so we can detect changes in play state reliably + // (TimeInfoFlags::TRANSPORT_CHANGED doesn't work the way we want it). + self.was_playing_in_last_cycle = self.is_now_playing(); + self.real_time_processor.lock_recover().run_from_vst( + #[cfg(feature = "playtime")] + buffer, + #[cfg(feature = "playtime")] + crate::domain::AudioBlockProps::from_vst(buffer, self.sample_rate), + &self.host, + ); + }); }); }