1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-11-25 17:28:50 -05:00

Heat Map: Fix overflow in average calculation.

This commit is contained in:
srcejon 2024-03-18 14:15:35 +00:00
parent 4d69da6ec2
commit 3c8f1abaee

View File

@ -198,7 +198,7 @@ void HeatMapSink::applySettings(const HeatMapSettings& settings, bool force)
|| (settings.m_sampleRate != m_settings.m_sampleRate)
|| force)
{
m_averageCnt = (int)((settings.m_averagePeriodUS * settings.m_sampleRate / 1e6));
m_averageCnt = (int)((settings.m_averagePeriodUS * (qint64)settings.m_sampleRate / 1e6));
// For low sample rates, we want a small buffer, so scope update isn't too slow
if (settings.m_sampleRate < 100) {
m_sampleBufferSize = 1;