summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2023-01-26 22:02:56 +0100
committerCarl Hetherington <cth@carlh.net>2023-01-26 22:02:56 +0100
commit4560105773c66ac9216b62313a24093bb0a027ae (patch)
treedc5018954f7c693cf5ffb502b9f34c6c03684bd1 /src
parentb7952108c279a68ada6d2b2626c6a42085a30805 (diff)
Fix crash when _nsamples is not a multiple of _nch (DoM #2432).
Diffstat (limited to 'src')
-rw-r--r--src/leqm_nrt.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/leqm_nrt.cc b/src/leqm_nrt.cc
index aa55fe0..280cab8 100644
--- a/src/leqm_nrt.cc
+++ b/src/leqm_nrt.cc
@@ -130,7 +130,8 @@ private:
void process()
{
- int const frames = _nsamples / _nch;
+ /* Round-up in case _nsamples is not a multiple of _nch */
+ int const frames = (_nsamples + _nch - 1) / _nch;
std::vector<double> ch_sum_accumulator_norm(frames);
std::vector<double> ch_sum_accumulator_conv(frames);