You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pdfbox.apache.org by "Tilman Hausherr (JIRA)" <ji...@apache.org> on 2016/04/27 17:45:13 UTC

[jira] [Resolved] (PDFBOX-3327) IndexOutOfBoundsException when retrieving kerning information

     [ https://issues.apache.org/jira/browse/PDFBOX-3327?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Tilman Hausherr resolved PDFBOX-3327.
-------------------------------------
       Resolution: Fixed
    Fix Version/s: 2.1.0
                   2.0.2

Thanks!

> 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
>             Fix For: 2.0.2, 2.1.0
>
>         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: dev-unsubscribe@pdfbox.apache.org
For additional commands, e-mail: dev-help@pdfbox.apache.org