diff options
author | David Robillard <d@drobilla.net> | 2014-11-18 02:26:37 -0500 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2014-11-18 02:53:28 -0500 |
commit | afd67800b969f9a1d5fe4fd4b7c8a0cbfe3a13b4 (patch) | |
tree | 570cd4b3489580f55ddde8d2786c89ea4e508cea /libs/ardour/export_graph_builder.cc | |
parent | c4c7598adbc9e5eca5fe04a23bb7e88fc0989f34 (diff) |
Avoid potential division by zero.
Diffstat (limited to 'libs/ardour/export_graph_builder.cc')
-rw-r--r-- | libs/ardour/export_graph_builder.cc | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/libs/ardour/export_graph_builder.cc b/libs/ardour/export_graph_builder.cc index 2c0c44033d..5e8c052b63 100644 --- a/libs/ardour/export_graph_builder.cc +++ b/libs/ardour/export_graph_builder.cc @@ -514,7 +514,9 @@ ExportGraphBuilder::ChannelConfig::ChannelConfig (ExportGraphBuilder & parent, F // Make the chunk size divisible by the channel count int chan_count = new_config.channel_config->get_n_chans(); max_frames_out = 8192; - max_frames_out -= max_frames_out % chan_count; + if (chan_count > 0) { + max_frames_out -= max_frames_out % chan_count; + } chunker.reset (new Chunker<Sample> (max_frames_out)); interleaver->add_output(chunker); |