diff --git a/decode.cpp b/decode.cpp index fc3f0745..d1fcffdb 100644 --- a/decode.cpp +++ b/decode.cpp @@ -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) {