From 7450d691890a198638d7c70fa8e999f5926a44de Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Sun, 7 Apr 2019 19:30:23 +0200 Subject: Verify Freeze/Export/Bounce polarity invert buffers When using bounce w/process, the initial bufferset can [wrongly] be buffers.set_count (track.max_processor_streams()) Since the polarity-processor is first in the chain, iterations over all buffer that don't have a matching _current_gain[] or _control[] leads to memory-corruption or segfault. --- libs/ardour/polarity_processor.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libs/ardour/polarity_processor.cc b/libs/ardour/polarity_processor.cc index 35d74a5795..7123e821f6 100644 --- a/libs/ardour/polarity_processor.cc +++ b/libs/ardour/polarity_processor.cc @@ -56,7 +56,8 @@ PolarityProcessor::configure_io (ChanCount in, ChanCount out) void PolarityProcessor::run (BufferSet& bufs, samplepos_t /*start_sample*/, samplepos_t /*end_sample*/, double /*speed*/, pframes_t nframes, bool) { - int chn = 0; + size_t chn = 0; + assert (bufs.count().n_audio () <= _current_gain.size()); if (!_active && !_pending_active) { /* fade all to unity */ for (BufferSet::audio_iterator i = bufs.audio_begin(); i != bufs.audio_end(); ++i, ++chn) { -- cgit v1.2.3