Tim Koopman created PDFBOX-3327:
-----------------------------------

             Summary: IndexOutOfBoundsException when retrieving kerning 
information
                 Key: PDFBOX-3327
                 URL: https://issues.apache.org/jira/browse/PDFBOX-3327
             Project: PDFBox
          Issue Type: Bug
          Components: FontBox
    Affects Versions: 2.0.0
            Reporter: Tim Koopman
            Priority: Minor


When using TrueTypeFont::getKerning there is a large possibility that you will 
run into an out of bounds exception. This is because the binary search is split 
into two parts, and the second part incorrectly adds the offset to the found 
index.

Actually, with the current implementation there is no need to split the search 
into two parts. This is only 'needed' when using a binary search implementation 
which is optimised for cases where the length of the array is a power of two, 
which Arrays::binarySearch doesn't implement.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to