diff options
author | Matthias P. Braendli <matthias.braendli@mpb.li> | 2018-03-27 19:38:01 +0200 |
---|---|---|
committer | Matthias P. Braendli <matthias.braendli@mpb.li> | 2018-03-27 19:38:01 +0200 |
commit | acd65685a06f23e4aae8304e0d81de52b54a1827 (patch) | |
tree | 8cbe79fa3e055944fcc737010c551d4cf56627d0 /src/ManagementServer.cpp | |
parent | 054b21d369a6cdddd7d309e1aad2cf0fa883c277 (diff) | |
download | dabmux-acd65685a06f23e4aae8304e0d81de52b54a1827.tar.gz dabmux-acd65685a06f23e4aae8304e0d81de52b54a1827.tar.bz2 dabmux-acd65685a06f23e4aae8304e0d81de52b54a1827.zip |
Fix segmentation fault
This bug occurs when the output is blocking, e.g. a pipe
and the input has time to fill quicker than with a nonblocking
output.
Diffstat (limited to 'src/ManagementServer.cpp')
-rw-r--r-- | src/ManagementServer.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/ManagementServer.cpp b/src/ManagementServer.cpp index 16a21b1..5741e38 100644 --- a/src/ManagementServer.cpp +++ b/src/ManagementServer.cpp @@ -428,7 +428,7 @@ void InputStat::notifyPeakLevels(int peak_left, int peak_right) // Calculate the peak over the short window m_short_window_length = PEAK_STATS_SHORT_WINDOW / insertion_interval; - const size_t short_window = std::max( + const size_t short_window = std::min( m_peaks_left.size(), m_short_window_length); const auto max_left = *max_element(m_peaks_left.begin(), m_peaks_left.begin() + short_window); |