Skip to content

Commit 488685a

Browse files
committed
PDFBOX-5660: avoid ArrayIndexOutOfBoundsException, as suggested by Ze Sheng; closes #411
git-svn-id: https://svn.apache.org/repos/asf/pdfbox/trunk@1931613 13f79535-47bb-0310-9956-ffa450edef68
1 parent 159ae24 commit 488685a

2 files changed

Lines changed: 263 additions & 248 deletions

File tree

fontbox/src/main/java/org/apache/fontbox/cmap/CMapParser.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -797,6 +797,10 @@ private static boolean isDelimiter(int aByte)
797797

798798
private static boolean increment(byte[] data, int position, boolean useStrictMode)
799799
{
800+
if (position < 0)
801+
{
802+
return false;
803+
}
800804
if (position > 0 && (data[position] & 0xFF) == 255)
801805
{
802806
// PDFBOX-4661: avoid overflow of the last byte, all following values are undefined

0 commit comments

Comments
 (0)