From 0ff5c93f382dc765d3cba43e10c658ce7965ffa9 Mon Sep 17 00:00:00 2001 From: zmiao Date: Wed, 4 Sep 2019 16:19:02 +0300 Subject: [PATCH 1/2] [core] fix integer overflow --- src/mbgl/tile/geometry_tile_data.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mbgl/tile/geometry_tile_data.cpp b/src/mbgl/tile/geometry_tile_data.cpp index adbcd6c5996..f723a948009 100644 --- a/src/mbgl/tile/geometry_tile_data.cpp +++ b/src/mbgl/tile/geometry_tile_data.cpp @@ -101,8 +101,8 @@ void limitHoles(GeometryCollection& polygon, uint32_t maxHoles) { static Feature::geometry_type convertGeometry(const GeometryTileFeature& geometryTileFeature, const CanonicalTileID& tileID) { const double size = util::EXTENT * std::pow(2, tileID.z); - const double x0 = util::EXTENT * tileID.x; - const double y0 = util::EXTENT * tileID.y; + const double x0 = util::EXTENT * static_cast(tileID.x); + const double y0 = util::EXTENT * static_cast(tileID.y); auto tileCoordinatesToLatLng = [&] (const Point& p) { double y2 = 180 - (p.y + y0) * 360 / size; From 6f7b49baa5c81f24af5e0d6e37d8ad39745669ac Mon Sep 17 00:00:00 2001 From: zmiao Date: Wed, 4 Sep 2019 17:05:07 +0300 Subject: [PATCH 2/2] [core] Add change log --- platform/android/CHANGELOG.md | 1 + platform/ios/CHANGELOG.md | 1 + platform/macos/CHANGELOG.md | 1 + platform/node/CHANGELOG.md | 1 + 4 files changed, 4 insertions(+) diff --git a/platform/android/CHANGELOG.md b/platform/android/CHANGELOG.md index 376a0b97e5c..93713afcbb8 100644 --- a/platform/android/CHANGELOG.md +++ b/platform/android/CHANGELOG.md @@ -14,6 +14,7 @@ Mapbox welcomes participation and contributions from everyone. If you'd like to ### Bug fixes - Fixed a rendering issue of `collisionBox` when `text-translate` or `icon-translate` is enabled. [#15467](https://github.com/mapbox/mapbox-gl-native/pull/15467) + - Fixed an issue of integer overflow when converting `tileCoordinates` to `LatLon`. [#15560](https://github.com/mapbox/mapbox-gl-native/pull/15560) ## 8.3.0 - August 28, 2019 [Changes](https://github.com/mapbox/mapbox-gl-native/compare/android-v8.3.0-beta.1...android-v8.3.0) since [Mapbox Maps SDK for Android v8.3.0-beta.1](https://github.com/mapbox/mapbox-gl-native/releases/tag/android-v8.3.0-beta.1): diff --git a/platform/ios/CHANGELOG.md b/platform/ios/CHANGELOG.md index 53afaccfe50..c94a8b70b46 100644 --- a/platform/ios/CHANGELOG.md +++ b/platform/ios/CHANGELOG.md @@ -9,6 +9,7 @@ Mapbox welcomes participation and contributions from everyone. Please read [CONT * Fixed a rendering issue of `collisionBox` when `text-translate` or `icon-translate` is enabled. ([#15467](https://github.com/mapbox/mapbox-gl-native/pull/15467)) * Fixed an issue where the scale bar text would become illegible if iOS 13 dark mode was enabled. ([#15524](https://github.com/mapbox/mapbox-gl-native/pull/15524)) * Enable using of `text-offset` option together with `text-variable-anchor` (if `text-radial-offset` option is not provided). If used with `text-variable-anchor`, input values will be taken as absolute values. Offsets along the x- and y-axis will be applied automatically based on the anchor position. ([#15542](https://github.com/mapbox/mapbox-gl-native/pull/15542)) + * Fixed an issue of integer overflow when converting `tileCoordinates` to `LatLon`. ([#15560](https://github.com/mapbox/mapbox-gl-native/pull/15560)) ### Performance improvements diff --git a/platform/macos/CHANGELOG.md b/platform/macos/CHANGELOG.md index bd1a84a495d..dc20a7e0108 100644 --- a/platform/macos/CHANGELOG.md +++ b/platform/macos/CHANGELOG.md @@ -15,6 +15,7 @@ * Fixed symbol overlap when zooming out quickly. ([15416](https://github.com/mapbox/mapbox-gl-native/pull/15416)) * Fixed a rendering issue that non-SDF icon would be treated as SDF icon if they are in the same layer. ([#15456](https://github.com/mapbox/mapbox-gl-native/pull/15456)) * Fixed a rendering issue of `collisionBox` when `text-translate` or `icon-translate` is enabled. ([#15467](https://github.com/mapbox/mapbox-gl-native/pull/15467)) +* Fixed an issue of integer overflow when converting `tileCoordinates` to `LatLon`. ([#15560](https://github.com/mapbox/mapbox-gl-native/pull/15560)) ### Styles and rendering diff --git a/platform/node/CHANGELOG.md b/platform/node/CHANGELOG.md index 43b18208b43..7a1ef4f1d74 100644 --- a/platform/node/CHANGELOG.md +++ b/platform/node/CHANGELOG.md @@ -3,6 +3,7 @@ * Fixed rendering and collision detection issues with using `text-variable-anchor` and `icon-text-fit` properties on the same layer ([#15367](https://github.com/mapbox/mapbox-gl-native/pull/15367)). * Fixed a rendering issue that non-SDF icon would be treated as SDF icon if they are in the same layer. ([#15456](https://github.com/mapbox/mapbox-gl-native/pull/15456)) * Fixed a rendering issue of `collisionBox` when `text-translate` or `icon-translate` is enabled. ([#15467](https://github.com/mapbox/mapbox-gl-native/pull/15467)) +* Fixed an issue of integer overflow when converting `tileCoordinates` to `LatLon`. ([#15560](https://github.com/mapbox/mapbox-gl-native/pull/15560)) # 4.2.0 - Add an option to set whether or not an image should be treated as a SDF ([#15054](https://github.com/mapbox/mapbox-gl-native/issues/15054))