From 9e089da98e2aae4dc895a733ae86d021788a69ca Mon Sep 17 00:00:00 2001 From: Eric Fischer Date: Mon, 11 Jun 2018 17:36:19 -0700 Subject: [PATCH] Fix division by 0: shift where I meant division --- decode.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/decode.cpp b/decode.cpp index 5992091..5ad37d7 100644 --- a/decode.cpp +++ b/decode.cpp @@ -89,7 +89,7 @@ void split_feature(mvt_layer const &layer, mvt_feature const &feature, std::vect static long clipid_pool = 0; const std::vector &geom = feature.geometry; long extent = layer.extent; - long nextent = extent >> n; + long nextent = extent / n; // Calculate bounding box of feature @@ -120,8 +120,8 @@ void split_feature(mvt_layer const &layer, mvt_feature const &feature, std::vect // XXX Is this right for edges on the border? long nclipid = 0; - if (minx / (extent >> n) != maxx / (extent >> n) || - miny / (extent >> n) != maxy / (extent >> n)) { + if (minx / nextent != maxx / nextent || + miny / nextent != maxy / nextent) { nclipid = ++clipid_pool; }