diff options
author | Konstantin Käfer <mail@kkaefer.com> | 2016-11-09 16:53:10 +0100 |
---|---|---|
committer | Konstantin Käfer <mail@kkaefer.com> | 2016-11-09 17:55:59 +0100 |
commit | 1afd9931848f79a03864be5248e0dc36ec5dec4b (patch) | |
tree | f2700e77f65b2b70e9fd01404440bd4d9a67c481 /src/mbgl/renderer/frame_history.hpp | |
parent | a9249b331afb3c98e5ce1d6d67910f3e23084b44 (diff) | |
download | qtlocation-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.hpp | 4 |
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; |