Guard against impossible tile coordinates when decoding

This commit is contained in:
Eric Fischer 2017-10-30 13:14:38 -07:00
parent e2b9b96ba8
commit 93a325605c

View File

@ -119,6 +119,12 @@ void handle(std::string message, int z, unsigned x, unsigned y, int describe, st
}
}
// X and Y are unsigned, so no need to check <0
if (x > (1 << z) || y > (1 << z)) {
fprintf(stderr, "Impossible tile %d/%u/%u\n", z, x, y);
exit(EXIT_FAILURE);
}
layer_to_geojson(stdout, layer, z, x, y, !pipeline, pipeline, pipeline, 0, 0, 0, !force);
if (!pipeline) {