You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pdfbox.apache.org by "Levin Rickert (Jira)" <ji...@apache.org> on 2021/09/29 13:01:00 UTC

[jira] [Updated] (PDFBOX-5285) EOFException during TTF parsing

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

Levin Rickert updated PDFBOX-5285:
----------------------------------
    Description: 
This exception is getting thrown while trying to parse a PDF file.
 I've extracted the problematic TTF file and tried to parse it directly via `TTFParser.parse`.
 The result is the same. The TTF file in question is attached.
{code:java}
java.io.EOFException
        at org.apache.fontbox.ttf.MemoryTTFDataStream.readSignedShort(MemoryTTFDataStream.java:138)
        at org.apache.fontbox.ttf.VerticalMetricsTable.read(VerticalMetricsTable.java:73)
        at org.apache.fontbox.ttf.TrueTypeFont.readTable(TrueTypeFont.java:361)
        at org.apache.fontbox.ttf.TTFParser.parseTables(TTFParser.java:173)
        at org.apache.fontbox.ttf.TTFParser.parse(TTFParser.java:150)
        at org.apache.fontbox.ttf.TTFParser.parse(TTFParser.java:106)
        at testing.Test.testTtfParsing(Test.java:46)
{code}
The code that was used for testing:
{code:java}
        try (InputStream ttfFile = Thread.currentThread().getContextClassLoader().getResourceAsStream("font-0011.ttf")) {
            TTFParser ttfParser = new TTFParser(false, false);
            ttfParser.parse(ttfFile);
        }
{code}

  was:
This exception is getting thrown while trying to parse a PDF file.
I've extracted the problematic TTF file and tried to parse it directly via `TTFParser.parse`.
The result is the same. The TTF file in question is attached.
{code:java}
java.io.EOFException
        at org.apache.fontbox.ttf.MemoryTTFDataStream.readSignedShort(MemoryTTFDataStream.java:138)
        at org.apache.fontbox.ttf.VerticalMetricsTable.read(VerticalMetricsTable.java:73)
        at org.apache.fontbox.ttf.TrueTypeFont.readTable(TrueTypeFont.java:361)
        at org.apache.fontbox.ttf.TTFParser.parseTables(TTFParser.java:173)
        at org.apache.fontbox.ttf.TTFParser.parse(TTFParser.java:150)
        at org.apache.fontbox.ttf.TTFParser.parse(TTFParser.java:106)
        at testing.Test.testTtfParsing(Test.java:46)
{code}


> EOFException during TTF parsing
> -------------------------------
>
>                 Key: PDFBOX-5285
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-5285
>             Project: PDFBox
>          Issue Type: Bug
>          Components: FontBox
>    Affects Versions: 2.0.24
>            Reporter: Levin Rickert
>            Priority: Major
>         Attachments: font-0011.ttf
>
>
> This exception is getting thrown while trying to parse a PDF file.
>  I've extracted the problematic TTF file and tried to parse it directly via `TTFParser.parse`.
>  The result is the same. The TTF file in question is attached.
> {code:java}
> java.io.EOFException
>         at org.apache.fontbox.ttf.MemoryTTFDataStream.readSignedShort(MemoryTTFDataStream.java:138)
>         at org.apache.fontbox.ttf.VerticalMetricsTable.read(VerticalMetricsTable.java:73)
>         at org.apache.fontbox.ttf.TrueTypeFont.readTable(TrueTypeFont.java:361)
>         at org.apache.fontbox.ttf.TTFParser.parseTables(TTFParser.java:173)
>         at org.apache.fontbox.ttf.TTFParser.parse(TTFParser.java:150)
>         at org.apache.fontbox.ttf.TTFParser.parse(TTFParser.java:106)
>         at testing.Test.testTtfParsing(Test.java:46)
> {code}
> The code that was used for testing:
> {code:java}
>         try (InputStream ttfFile = Thread.currentThread().getContextClassLoader().getResourceAsStream("font-0011.ttf")) {
>             TTFParser ttfParser = new TTFParser(false, false);
>             ttfParser.parse(ttfFile);
>         }
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

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