Fix overflow when iterating through 0-length lists backwards

This commit is contained in:
Eric Fischer
2017-11-17 15:47:10 -08:00
parent 6fd4918c4d
commit 9a12a76855
3 changed files with 4 additions and 3 deletions
+1 -1
View File
@@ -1631,7 +1631,7 @@ long long write_tile(FILE *geoms, long long *geompos_in, char *metabase, char *s
}
// Attach any pieces that were waiting to be coalesced onto some features that did make it.
for (ssize_t i = coalesced_geometry.size() - 1; i >= 0; i--) {
for (ssize_t i = (ssize_t) coalesced_geometry.size() - 1; i >= 0; i--) {
for (ssize_t j = partials.size() - 1; j >= 0; j--) {
if (partials[j].layer == coalesced_geometry[i].layer && partials[j].t == coalesced_geometry[i].t) {
for (size_t k = 0; k < coalesced_geometry[i].geometry.size(); k++) {