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

Nullpointer exception in getLeftSideBearing

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.0.6
    • Fix Version/s: 2.0.7, 3.0.0 PDFBox
    • Component/s: FontBox
    • Labels:
      None

      Description

      While processing todays batch of data we got a Nullpointer exception in getLeftSideBearing. Sadly I can't give you the PDF.

      ```
      public int getLeftSideBearing(int gid)

      { return gid < this.numHMetrics?this.leftSideBearing[gid]:this.nonHorizontalLeftSideBearing[gid - this.numHMetrics]; }

      ```

      In this function there could be a case where nonHorizontalLeftSideBearing is null and you still ask for a GID in larger or equal to numHMetrics.

      First time I see this issue and so far only 4 characters in one PDF has this issue so not critical.

        Attachments

        1. font.raw
          5 kB
          Daniel Persson

          Activity

            People

            • Assignee:
              tilman Tilman Hausherr
              Reporter:
              kalaspuffar Daniel Persson
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: