From 3c8f1abaeea7584d64e5f93fbf246c1f653c174d Mon Sep 17 00:00:00 2001 From: srcejon Date: Mon, 18 Mar 2024 14:15:35 +0000 Subject: [PATCH] Heat Map: Fix overflow in average calculation. --- plugins/channelrx/heatmap/heatmapsink.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/channelrx/heatmap/heatmapsink.cpp b/plugins/channelrx/heatmap/heatmapsink.cpp index b6c90fa32..e7a6bc3de 100644 --- a/plugins/channelrx/heatmap/heatmapsink.cpp +++ b/plugins/channelrx/heatmap/heatmapsink.cpp @@ -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;