lgtm issues: potential index out of bounds exceptions

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1849127 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
PJ Fanning 2018-12-17 20:41:38 +00:00
parent d1400559f8
commit 1aeadee8c4
1 changed files with 3 additions and 0 deletions

View File

@ -783,6 +783,9 @@ public class HemfDraw {
int mode2 = leis.readUByte();
int mode3 = leis.readUByte();
assert(mode2 == 0x04 && (mode3 == 0x04 || mode3 == 0x05));
if ((i + 2) > points.length) {
throw new IllegalStateException("Points index causes index out of bounds");
}
poly.curveTo(
points[i].getX(), points[i].getY(),
points[i+1].getX(), points[i+1].getY(),