mirror of
https://github.com/felt/tippecanoe.git
synced 2026-10-05 09:55:41 +02:00
Guard against impossible zoom level
This commit is contained in:
@@ -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);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user