You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pdfbox.apache.org by "Erik Hetzner (JIRA)" <ji...@apache.org> on 2013/10/15 01:58:42 UTC

[jira] [Commented] (PDFBOX-1749) Out of memory exception when parsing TTF file

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

Erik Hetzner commented on PDFBOX-1749:
--------------------------------------

For compiling testcase:
{code}
$ javac -classpath fontbox-1.8.3-20130916.151050-5.jar PDFBOX_1749.java 
{code}

Running using FileInputStream:

{code}
$ java -Xmx8000m -cp fontbox-1.8.3-20130916.151050-5.jar:. PDFBOX_1749 16A4FF_8.ttf X
Using FileInputStream
error: array index out of bounds
Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
	at java.util.ArrayList.newElementArray(ArrayList.java:94)
	at java.util.ArrayList.growAtEnd(ArrayList.java:375)
	at java.util.ArrayList.add(ArrayList.java:158)
	at org.apache.fontbox.ttf.GlyfCompositeDescript.<init>(GlyfCompositeDescript.java:60)
	at org.apache.fontbox.ttf.GlyphData.initData(GlyphData.java:63)
	at org.apache.fontbox.ttf.GlyphTable.initData(GlyphTable.java:71)
	at org.apache.fontbox.ttf.AbstractTTFParser.parseTables(AbstractTTFParser.java:163)
	at org.apache.fontbox.ttf.TTFParser.parseTables(TTFParser.java:61)
	at org.apache.fontbox.ttf.AbstractTTFParser.parseTTF(AbstractTTFParser.java:90)
	at org.apache.fontbox.ttf.AbstractTTFParser.parseTTF(AbstractTTFParser.java:66)
	at PDFBOX_1749.main(PDFBOX_1749.java:13)
{code}

Running as File:
{code}
$ java -Xmx8000m -cp fontbox-1.8.3-20130916.151050-5.jar:. PDFBOX_1749 16A4FF_8.ttf
Using File
[...]
{code}

> Out of memory exception when parsing TTF file
> ---------------------------------------------
>
>                 Key: PDFBOX-1749
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-1749
>             Project: PDFBox
>          Issue Type: Bug
>          Components: FontBox
>    Affects Versions: 1.8.3
>         Environment: ubuntu
> java version "1.7.0_40"
> Java(TM) SE Runtime Environment (build 1.7.0_40-b43)
> Java HotSpot(TM) 64-Bit Server VM (build 24.0-b56, mixed mode)
>            Reporter: Erik Hetzner
>         Attachments: 16A4FF_8.ttf, PDFBOX_1749.java
>
>
> When parsing the attached TTF file with fontbox, I get an OutOfMemoryError (heap space) when parsing via an input stream. If I parse via a File, fontbox seems to never return.



--
This message was sent by Atlassian JIRA
(v6.1#6144)