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 2023/12/12 10:10:00 UTC

[jira] [Resolved] (PDFBOX-5728) NullPointerException in TTFSubsetter.buildPostTable()

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

Tilman Hausherr resolved PDFBOX-5728.
-------------------------------------
      Assignee: Tilman Hausherr
    Resolution: Fixed

... and done. Thanks for the report!

> NullPointerException in TTFSubsetter.buildPostTable()
> -----------------------------------------------------
>
>                 Key: PDFBOX-5728
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-5728
>             Project: PDFBox
>          Issue Type: Bug
>          Components: FontBox
>    Affects Versions: 2.0.28, 3.0.1 PDFBox
>            Reporter: Daniel Gredler
>            Assignee: Tilman Hausherr
>            Priority: Major
>             Fix For: 2.0.31, 3.0.2 PDFBox, 4.0.0
>
>         Attachments: NotoMono-Regular.ttf
>
>
> It looks like `TTFSubsetter.buildPostTable()` can sometimes throw NPEs:
> java.lang.NullPointerException: null
>         at org.apache.fontbox.ttf.TTFSubsetter.buildPostTable(TTFSubsetter.java:859)
>         at org.apache.fontbox.ttf.TTFSubsetter.writeToStream(TTFSubsetter.java:971)
> Looking at the code, the `names` map keys are Strings that come from `PostScriptTable.getName(gid)`, which can sometimes return `null`. A few lines later, these possibly-null String keys are converted to bytes, at which point the system may throw a NPE.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@pdfbox.apache.org
For additional commands, e-mail: dev-help@pdfbox.apache.org