[ 
https://issues.apache.org/jira/browse/PDFBOX-808?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12906986#action_12906986
 ] 

Jukka Zitting commented on PDFBOX-808:
--------------------------------------

Thanks for the attachment! I debugged the parsing process and found out that 
the font file uses glyph name indexes in the reserved range from 32768 to 65535 
(see version 2.0 in http://www.microsoft.com/typography/otspec/post.htm). The 
parsing algorithm in FontBox was not prepared to handle such reserved glyph 
name indexes,  which is why it ended up trying to read past the end of the font 
file. I fixed that in revision 993541 by making the parser explicitly ignore 
such reserved glyph name indexes.

> PDTrueTypeFont.loadTTF() freezes (at TTFDataStream.java:195)
> ------------------------------------------------------------
>
>                 Key: PDFBOX-808
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-808
>             Project: PDFBox
>          Issue Type: Bug
>          Components: FontBox
>    Affects Versions: 1.2.1
>         Environment: PDFBox 1.2.1, JDK 1.6.0_21, Windows XP 32 Bit.
>            Reporter: Martin Hilpert
>            Assignee: Jukka Zitting
>            Priority: Critical
>             Fix For: 1.3.0
>
>         Attachments: nbrm____.zip
>
>
> Sometimes (not always), my app "freezes". When I look into jVisualVM thread 
> dump, I see this stack trace:
>    java.lang.Thread.State: RUNNABLE
>       at org.apache.fontbox.ttf.TTFDataStream.read(TTFDataStream.java:195)
>       at 
> org.apache.fontbox.ttf.TTFDataStream.readString(TTFDataStream.java:69)
>       at 
> org.apache.fontbox.ttf.TTFDataStream.readString(TTFDataStream.java:57)
>       at 
> org.apache.fontbox.ttf.PostScriptTable.initData(PostScriptTable.java:104)
>       at org.apache.fontbox.ttf.TTFParser.parseTTF(TTFParser.java:140)
>       at org.apache.fontbox.ttf.TTFParser.parseTTF(TTFParser.java:87)
>       at 
> org.apache.pdfbox.pdmodel.font.PDTrueTypeFont.loadDescriptorDictionary(PDTrueTypeFont.java:206)
>       at 
> org.apache.pdfbox.pdmodel.font.PDTrueTypeFont.loadTTF(PDTrueTypeFont.java:167)
>       at 
> org.apache.pdfbox.pdmodel.font.PDTrueTypeFont.loadTTF(PDTrueTypeFont.java:143)
>       at 
> org.apache.pdfbox.pdmodel.font.PDTrueTypeFont.loadTTF(PDTrueTypeFont.java:130)
> It never returns and blocks the application from continuing. This hapend 
> several times now every few hours.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to