diff options
author | PJ Fanning <fanningpj@apache.org> | 2018-12-17 20:41:38 +0000 |
---|---|---|
committer | PJ Fanning <fanningpj@apache.org> | 2018-12-17 20:41:38 +0000 |
commit | 1aeadee8c47cde75aece660ce28b79be273d8752 (patch) | |
tree | 5daaef10380b7c710fa24cd5cbf523804b2f9c1e | |
parent | d1400559f88c97cdc71cb263d6b66aa547903167 (diff) | |
download | poi-1aeadee8c47cde75aece660ce28b79be273d8752.tar.gz poi-1aeadee8c47cde75aece660ce28b79be273d8752.zip |
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
-rw-r--r-- | src/scratchpad/src/org/apache/poi/hemf/record/emf/HemfDraw.java | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/scratchpad/src/org/apache/poi/hemf/record/emf/HemfDraw.java b/src/scratchpad/src/org/apache/poi/hemf/record/emf/HemfDraw.java index 7e495e2868..2eae698b16 100644 --- a/src/scratchpad/src/org/apache/poi/hemf/record/emf/HemfDraw.java +++ b/src/scratchpad/src/org/apache/poi/hemf/record/emf/HemfDraw.java @@ -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(), |