summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/util.cc4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/lib/util.cc b/src/lib/util.cc
index e0efbc6f5..f9877523a 100644
--- a/src/lib/util.cc
+++ b/src/lib/util.cc
@@ -823,7 +823,9 @@ remap (shared_ptr<const AudioBuffers> input, int output_channels, AudioMapping m
shared_ptr<AudioBuffers> mapped (new AudioBuffers (output_channels, input->frames()));
mapped->make_silent ();
- for (int i = 0; i < map.input_channels(); ++i) {
+ int to_do = min (map.input_channels(), input->channels());
+
+ for (int i = 0; i < to_do; ++i) {
for (int j = 0; j < mapped->channels(); ++j) {
if (map.get (i, static_cast<dcp::Channel> (j)) > 0) {
mapped->accumulate_channel (