Merge pull request #485 from mapbox/milo-bounds

Port fix for array index out of bounds in decimal conversion
This commit is contained in:
Eric Fischer
2017-11-03 10:10:12 -07:00
committed by GitHub
3 changed files with 7 additions and 2 deletions
+4
View File
@@ -1,3 +1,7 @@
## 1.26.4
* Array bounds bug fix in binary to decimal conversion library
## 1.26.3 ## 1.26.3
* Guard against impossible coordinates when decoding tilesets * Guard against impossible coordinates when decoding tilesets
+2 -1
View File
@@ -284,7 +284,8 @@ inline void DigitGen(const DiyFp& W, const DiyFp& Mp, uint64_t delta, std::strin
kappa--; kappa--;
if (p2 < delta) { if (p2 < delta) {
*K += kappa; *K += kappa;
GrisuRound(buffer, *len, delta, p2, one.f, wp_w.f * kPow10[-kappa]); int index = -static_cast<int>(kappa);
GrisuRound(buffer, *len, delta, p2, one.f, wp_w.f * (index < 9 ? kPow10[-static_cast<int>(kappa)] : 0));
return; return;
} }
} }
+1 -1
View File
@@ -1,6 +1,6 @@
#ifndef VERSION_HPP #ifndef VERSION_HPP
#define VERSION_HPP #define VERSION_HPP
#define VERSION "tippecanoe v1.26.3\n" #define VERSION "tippecanoe v1.26.4\n"
#endif #endif