From dd8f43a697ea0b4b1b264e7f71230e41ab9e6db8 Mon Sep 17 00:00:00 2001 From: Eric Fischer Date: Tue, 23 Sep 2014 12:17:18 -0700 Subject: [PATCH] Bail if the tile size is larger than the uploader will accept --- tile.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tile.cc b/tile.cc index d791b212..3a30cb0e 100644 --- a/tile.cc +++ b/tile.cc @@ -205,7 +205,11 @@ void write_tile(struct index *start, struct index *end, char *metabase, unsigned tile.SerializeToString(&s); compress(s, compressed); - //std::cout << compressed; + + if (compressed.size() > 500000) { + fprintf(stderr, "tile %d/%u/%u size is %lld, >500000\n", z, tx, ty, (long long) compressed.size()); + exit(EXIT_FAILURE); + } const char *prefix = "tiles"; char path[strlen(prefix) + 200];