mirror of
https://github.com/mapbox/tippecanoe.git
synced 2025-02-23 02:22:34 +00:00
Guard against impossible zoom level
This commit is contained in:
parent
d13e08c9b5
commit
dfbb13e7db
@ -24,6 +24,11 @@ void enumerate(char *fname) {
|
|||||||
long long x = sqlite3_column_int(stmt, 1);
|
long long x = sqlite3_column_int(stmt, 1);
|
||||||
long long y = sqlite3_column_int(stmt, 2);
|
long long y = sqlite3_column_int(stmt, 2);
|
||||||
|
|
||||||
|
if (zoom < 0 || zoom > 31) {
|
||||||
|
fprintf(stderr, "Corrupt mbtiles file: impossible zoom level %lld\n", zoom);
|
||||||
|
exit(EXIT_FAILURE);
|
||||||
|
}
|
||||||
|
|
||||||
y = (1LL << zoom) - 1 - y;
|
y = (1LL << zoom) - 1 - y;
|
||||||
printf("%s %lld %lld %lld\n", fname, zoom, x, y);
|
printf("%s %lld %lld %lld\n", fname, zoom, x, y);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user