summaryrefslogtreecommitdiff
path: root/src/mbgl/renderer/frame_history.hpp
diff options
context:
space:
mode:
authorKonstantin Käfer <mail@kkaefer.com>2016-11-09 16:53:10 +0100
committerKonstantin Käfer <mail@kkaefer.com>2016-11-09 17:55:59 +0100
commit1afd9931848f79a03864be5248e0dc36ec5dec4b (patch)
treef2700e77f65b2b70e9fd01404440bd4d9a67c481 /src/mbgl/renderer/frame_history.hpp
parenta9249b331afb3c98e5ce1d6d67910f3e23084b44 (diff)
downloadqtlocation-mapboxgl-1afd9931848f79a03864be5248e0dc36ec5dec4b.tar.gz
[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.
Diffstat (limited to 'src/mbgl/renderer/frame_history.hpp')
-rw-r--r--src/mbgl/renderer/frame_history.hpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/mbgl/renderer/frame_history.hpp b/src/mbgl/renderer/frame_history.hpp
index d8fd06d27b..dfa2751038 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;