From 8b56dd54683a5baeae5b8d848c56dc0cdc26d4f3 Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Fri, 8 May 2020 01:55:03 +0200 Subject: [PATCH] Prevent division by zero. --- server/TracyWorker.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/TracyWorker.cpp b/server/TracyWorker.cpp index 66599e69..48cfbb42 100644 --- a/server/TracyWorker.cpp +++ b/server/TracyWorker.cpp @@ -3081,7 +3081,7 @@ void Worker::UpdateMbps( int64_t td ) m_mbpsData.mbps.erase( m_mbpsData.mbps.begin() ); m_mbpsData.mbps.emplace_back( bytes / ( td * 125.f ) ); } - m_mbpsData.compRatio = float( bytes ) / decBytes; + m_mbpsData.compRatio = decBytes == 0 ? 1 : float( bytes ) / decBytes; m_mbpsData.queue = m_serverQueryQueue.size(); m_mbpsData.transferred += bytes; }