mirror of
https://github.com/mapbox/tippecanoe.git
synced 2025-03-29 15:06:01 +00:00
Fix opportunities for integer overflow
This commit is contained in:
parent
e07a4dd51b
commit
d49606babf
@ -1,3 +1,7 @@
|
||||
## 1.27.6
|
||||
|
||||
* Fix opportunities for integer overflow and out-of-bounds references
|
||||
|
||||
## 1.27.5
|
||||
|
||||
* Add --cluster-densest-as-needed to cluster features
|
||||
|
@ -473,7 +473,11 @@ int serialize_feature(struct serialization_state *sst, serial_feature &sf) {
|
||||
}
|
||||
}
|
||||
|
||||
sf.extent = (long long) extent;
|
||||
if (extent <= LLONG_MAX) {
|
||||
sf.extent = (long long) extent;
|
||||
} else {
|
||||
sf.extent = LLONG_MAX;
|
||||
}
|
||||
|
||||
if (!prevent[P_INPUT_ORDER]) {
|
||||
sf.seq = 0;
|
||||
|
File diff suppressed because one or more lines are too long
@ -1,6 +1,6 @@
|
||||
#ifndef VERSION_HPP
|
||||
#define VERSION_HPP
|
||||
|
||||
#define VERSION "tippecanoe v1.27.5\n"
|
||||
#define VERSION "tippecanoe v1.27.6\n"
|
||||
|
||||
#endif
|
||||
|
@ -118,19 +118,11 @@ void layer_to_geojson(FILE *fp, mvt_layer const &layer, unsigned z, unsigned x,
|
||||
} else if (val.type == mvt_double) {
|
||||
fprintq(fp, key);
|
||||
double v = val.numeric_value.double_value;
|
||||
if (v == (long long) v) {
|
||||
fprintf(fp, ": %lld", (long long) v);
|
||||
} else {
|
||||
fprintf(fp, ": %s", milo::dtoa_milo(v).c_str());
|
||||
}
|
||||
fprintf(fp, ": %s", milo::dtoa_milo(v).c_str());
|
||||
} else if (val.type == mvt_float) {
|
||||
fprintq(fp, key);
|
||||
double v = val.numeric_value.float_value;
|
||||
if (v == (long long) v) {
|
||||
fprintf(fp, ": %lld", (long long) v);
|
||||
} else {
|
||||
fprintf(fp, ": %s", milo::dtoa_milo(v).c_str());
|
||||
}
|
||||
fprintf(fp, ": %s", milo::dtoa_milo(v).c_str());
|
||||
} else if (val.type == mvt_sint) {
|
||||
fprintq(fp, key);
|
||||
fprintf(fp, ": %lld", val.numeric_value.sint_value);
|
||||
|
Loading…
x
Reference in New Issue
Block a user