From eebf0dd7c99a962a33f653c7b38c27025bc3ac86 Mon Sep 17 00:00:00 2001 From: catree Date: Wed, 7 Nov 2018 11:54:51 +0100 Subject: [PATCH] Fix integer overflow when accumulating timing values. --- modules/dnn/src/dnn.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/dnn/src/dnn.cpp b/modules/dnn/src/dnn.cpp index 0afa8d5a27..027b59160a 100644 --- a/modules/dnn/src/dnn.cpp +++ b/modules/dnn/src/dnn.cpp @@ -3074,7 +3074,7 @@ void Net::setHalideScheduler(const String& scheduler) int64 Net::getPerfProfile(std::vector& timings) { timings = std::vector(impl->layersTimings.begin() + 1, impl->layersTimings.end()); - int64 total = std::accumulate(timings.begin(), timings.end(), 0); + int64 total = (int64)std::accumulate(timings.begin(), timings.end(), 0.0); return total; }