diff options
author | Robin Gareus <robin@gareus.org> | 2019-04-07 19:30:23 +0200 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2019-04-07 19:51:49 +0200 |
commit | 7450d691890a198638d7c70fa8e999f5926a44de (patch) | |
tree | bcc2048bd1e0417e8d709ff44e39ab86aad35b4b /libs/ardour/polarity_processor.cc | |
parent | 1557ea531444b3f7385ed0250ff79b51e8d93a23 (diff) |
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.
Diffstat (limited to 'libs/ardour/polarity_processor.cc')
-rw-r--r-- | libs/ardour/polarity_processor.cc | 3 |
1 files changed, 2 insertions, 1 deletions
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) { |