Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
sebasbaumh committed May 18, 2022
1 parent 4cf5b37 commit f3dda05
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -211,9 +211,13 @@ private static Geometry readPoints(GeometryFactory geomFactory, List<Integer> ge

// Guard: header data unsupported by geometry command buffer
// (require header and at least 1 value * 2 params)
if(cmdLength * GeomCmd.MoveTo.getParamCount() + 1 > geomCmds.size()) {
int requiredgeomCmdsLength = cmdLength * GeomCmd.MoveTo.getParamCount() + 1;
if(requiredgeomCmdsLength > geomCmds.size()) {
return null;
}
if (requiredgeomCmdsLength < geomCmds.size()) {
geomCmds = geomCmds.subList(0, requiredgeomCmdsLength); // ignore extra commands... should it return null instead?
}

final CoordinateSequence coordSeq = geomFactory.getCoordinateSequenceFactory().create(cmdLength, 2);
int coordIndex = 0;
Expand Down

0 comments on commit f3dda05

Please sign in to comment.