diff options
author | zmiao <miao.zhao@mapbox.com> | 2020-04-07 16:30:30 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-07 16:30:30 +0300 |
commit | bf4c7340f32c1e673e6a37b91fc65305757f52d1 (patch) | |
tree | c7871ff8901617b09d8a8d45b57334c2198b9b99 /src/mbgl/map | |
parent | 8986b558eb92e431c773b6033d8ae271eb71de00 (diff) | |
download | qtlocation-mapboxgl-bf4c7340f32c1e673e6a37b91fc65305757f52d1.tar.gz |
[build] Fix undefined behavour sanitizer (#16375)
* [build] Fix integer overflow runtime error for core part
Temporarily remove circle ci UBSAN build precondition
* [build] Enable all of the ubsans
[build] Check runtime error
[build] Update UBSAN_OPTION
* [build] Add UBSAN blacklist
[build] Ignore system libraries
[build] Ignore vendor library
* [build] Fix implicit conversion runtime error in core
* [build] Fix division by zero runtime error
* [build] Add unfixed error to ubsan blacklist
* [build] Make UBSAN halt on error
Revert "Temporary remove build precondition"
* [build] Fix division by zero error
* [build] Make UBSAN officially work without FIXME prefix
* [build] Fix implicit conversion from int64_t to uint64_t
* [build] Rename style test json file name
* Address review findings
Diffstat (limited to 'src/mbgl/map')
-rw-r--r-- | src/mbgl/map/transform_state.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/mbgl/map/transform_state.cpp b/src/mbgl/map/transform_state.cpp index 1894c59e2b..0333f4860c 100644 --- a/src/mbgl/map/transform_state.cpp +++ b/src/mbgl/map/transform_state.cpp @@ -70,8 +70,11 @@ void TransformState::matrixFor(mat4& matrix, const UnwrappedTileID& tileID) cons const double s = Projection::worldSize(scale) / tileScale; matrix::identity(matrix); - matrix::translate( - matrix, matrix, int64_t(tileID.canonical.x + tileID.wrap * tileScale) * s, int64_t(tileID.canonical.y) * s, 0); + matrix::translate(matrix, + matrix, + int64_t(tileID.canonical.x + tileID.wrap * static_cast<int64_t>(tileScale)) * s, + int64_t(tileID.canonical.y) * s, + 0); matrix::scale(matrix, matrix, s / util::EXTENT, s / util::EXTENT, 1); } |