fix: grow of GeometryBuffer properly

This commit is contained in:
Hannes Janetzek 2013-05-06 04:42:19 +02:00
parent 9d96be70fa
commit 9bbfef02ad

View File

@ -97,8 +97,10 @@ public class GeometryBuffer {
// initialize with zero points // initialize with zero points
index[indexPos] = 0; index[indexPos] = 0;
// set new end marker // set new end marker
index[indexPos + 1] = -1; if (index.length > indexPos + 1)
index[indexPos + 1] = -1;
} }
public void startPolygon() { public void startPolygon() {
@ -122,8 +124,10 @@ public class GeometryBuffer {
// initialize with zero points // initialize with zero points
index[indexPos] = 0; index[indexPos] = 0;
// set new end marker // set new end marker
index[indexPos + 1] = -1; if (index.length > indexPos + 1)
index[indexPos + 1] = -1;
} }
public void startHole() { public void startHole() {