diff --git a/utils/shapeindex/shapeindex.cpp b/utils/shapeindex/shapeindex.cpp index e6ce36bee..a9c524249 100644 --- a/utils/shapeindex/shapeindex.cpp +++ b/utils/shapeindex/shapeindex.cpp @@ -162,7 +162,7 @@ int main (int argc,char** argv) mapnik::quad_tree tree(extent, depth, ratio); int count = 0; - while (shx.is_good() && pos <= file_length + 4) + while (shx.is_good() && pos <= file_length - 4) { int offset = shx.read_xdr_integer(); int content_length = shx.read_xdr_integer();