From 242a657fc158a71417f580e10e15dd437bb3c1ff Mon Sep 17 00:00:00 2001 From: Eric Fischer Date: Thu, 13 Apr 2017 14:23:43 -0700 Subject: [PATCH] Fix array bounds error caught by -fsanitize=address --- main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.cpp b/main.cpp index 0770c82..8d42103 100644 --- a/main.cpp +++ b/main.cpp @@ -1571,7 +1571,7 @@ int read_input(std::vector &sources, char *fname, int &maxzoom, int minz long long progress = -1; long long ip; - for (ip = 0; ip < indices; ip++) { + for (ip = 1; ip < indices; ip++) { if (map[ip].index != map[ip - 1].index) { count++; sum += log(map[ip].index - map[ip - 1].index);