From 1afd9931848f79a03864be5248e0dc36ec5dec4b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Konstantin=20K=C3=A4fer?= Date: Wed, 9 Nov 2016 16:53:10 +0100 Subject: [PATCH] [core] don't initialize with Duration::min() to avoid arithmetic overflows In FrameHistory::needsAnimation, we are computing "time - previousTime", but since previousTime was initialized to Duration::min(), we got a integer overflow, which produced invalid values. --- src/mbgl/renderer/frame_history.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mbgl/renderer/frame_history.hpp b/src/mbgl/renderer/frame_history.hpp index d8fd06d27..dfa275103 100644 --- a/src/mbgl/renderer/frame_history.hpp +++ b/src/mbgl/renderer/frame_history.hpp @@ -29,8 +29,8 @@ private: const AlphaImage opacities{ { 256, 1 } }; int16_t previousZoomIndex = 0; - TimePoint previousTime = TimePoint::min(); - TimePoint time = TimePoint::min(); + TimePoint previousTime; + TimePoint time; bool firstFrame = true; bool dirty = true;