From c263d941dae0c913a4c89e04c6229116e5d5dbf1 Mon Sep 17 00:00:00 2001 From: Jonathan G Rennison Date: Sun, 30 Jul 2023 11:04:42 +0100 Subject: [PATCH] Clamp runtime to be non-zero in FlowMapper::Run --- src/linkgraph/flowmapper.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/linkgraph/flowmapper.cpp b/src/linkgraph/flowmapper.cpp index b7a43f2562..8176abbb43 100644 --- a/src/linkgraph/flowmapper.cpp +++ b/src/linkgraph/flowmapper.cpp @@ -53,7 +53,7 @@ void FlowMapper::Run(LinkGraphJob &job) const /* Scale by time the graph has been running without being compressed. Add 1 to avoid * division by 0 if spawn date == last compression date. This matches * LinkGraph::Monthly(). */ - uint runtime = ClampTo(DateTicksToScaledDateTicks(job.StartDateTicks()) - job.LastCompression() + 1); + uint runtime = (uint)Clamp(DateTicksToScaledDateTicks(job.StartDateTicks()) - job.LastCompression() + 1, 1, UINT32_MAX); for (auto &it : flows) { it.ScaleToMonthly(runtime); }