Uploaded image for project: 'PDFBox'
  1. PDFBox
  2. PDFBOX-3327

IndexOutOfBoundsException when retrieving kerning information

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 2.0.0, 2.0.1, 2.0.2, 3.0.0 PDFBox
    • 2.0.2, 3.0.0 PDFBox
    • FontBox
    • None

    Description

      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.

      Attachments

        Issue Links

          Activity

            People

              tilman Tilman Hausherr
              ntkoopman Tim Koopman
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: