From 0270997acd9f164d0f828c3bc787a446d8e4f3dd Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Tue, 12 Jul 2022 16:03:09 -0400 Subject: [PATCH] Add insurance against calls before setup. --- Outputs/Speaker/Implementation/LowpassSpeaker.hpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Outputs/Speaker/Implementation/LowpassSpeaker.hpp b/Outputs/Speaker/Implementation/LowpassSpeaker.hpp index 202c7f194..b225d2585 100644 --- a/Outputs/Speaker/Implementation/LowpassSpeaker.hpp +++ b/Outputs/Speaker/Implementation/LowpassSpeaker.hpp @@ -170,6 +170,10 @@ template class LowpassBase: public Speaker } inline void resample_input_buffer(int scale) { + if(output_buffer_.empty()) { + return; + } + if constexpr (is_stereo) { output_buffer_[output_buffer_pointer_ + 0] = filter_->apply(input_buffer_.data(), 2); output_buffer_[output_buffer_pointer_ + 1] = filter_->apply(input_buffer_.data() + 1, 2);