[ 
https://issues.apache.org/jira/browse/PDFBOX-3327?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15260339#comment-15260339
 ] 

ASF subversion and git services commented on PDFBOX-3327:
---------------------------------------------------------

Commit 1741279 from [~tilman] in branch 'pdfbox/trunk'
[ https://svn.apache.org/r1741279 ]

PDFBOX-3327: simplify and avoid alleged IOOBE as proposed by Tim Koopman

> 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, 2.0.1, 2.0.2, 2.1.0
>            Reporter: Tim Koopman
>            Assignee: Tilman Hausherr
>            Priority: Minor
>         Attachments: 
> PDFBOX_3327__Fix_IndexOutOfBoundsException_when_searching_kerning_subtable.patch
>
>
> 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