[ https://issues.apache.org/jira/browse/PDFBOX-2439?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14181334#comment-14181334 ]
simon steiner commented on PDFBOX-2439: --------------------------------------- Quick hack: --- a/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/FileSystemFontProvider.java +++ b/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/FileSystemFontProvider.java @@ -206,7 +206,7 @@ final class FileSystemFontProvider implements FontProvider { ttf = ttfParser.parse(file); - ttfFonts.put(postScriptName, ttf); +// ttfFonts.put(postScriptName, ttf); if (LOG.isDebugEnabled()) { LOG.debug("Loaded " + postScriptName + " from " + file); @@ -244,7 +244,7 @@ final class FileSystemFontProvider implements FontProvider byte[] bytes = IOUtils.toByteArray(input); CFFParser cffParser = new CFFParser(); cff = cffParser.parse(bytes).get(0); - cffFonts.put(postScriptName, cff); +// cffFonts.put(postScriptName, cff); if (LOG.isDebugEnabled()) { LOG.debug("Loaded " + postScriptName + " from " + file); @@ -280,7 +280,7 @@ final class FileSystemFontProvider implements FontProvider { input = new FileInputStream(file); type1 = Type1Font.createWithPFB(input); - type1Fonts.put(postScriptName, type1); +// type1Fonts.put(postScriptName, type1); > ArrayIndexOutOfBoundsException in multithreaded system > ------------------------------------------------------ > > Key: PDFBOX-2439 > URL: https://issues.apache.org/jira/browse/PDFBOX-2439 > Project: PDFBox > Issue Type: Bug > Components: FontBox > Affects Versions: 2.0.0 > Reporter: simon steiner > Priority: Critical > Fix For: 2.0.0 > > Attachments: TestPDFBox.java > > > When it loads replacement font from OS i sometimes get: > Exception in thread "Thread-27" java.lang.ArrayIndexOutOfBoundsException: > 40036 > at > org.apache.fontbox.ttf.GlyfSimpleDescript.readFlags(GlyfSimpleDescript.java:197) > at > org.apache.fontbox.ttf.GlyfSimpleDescript.<init>(GlyfSimpleDescript.java:78) > at org.apache.fontbox.ttf.GlyphData.initData(GlyphData.java:58) > at org.apache.fontbox.ttf.GlyphTable.getGlyph(GlyphTable.java:161) > at > org.apache.pdfbox.rendering.font.TTFGlyph2D.getPathForGID(TTFGlyph2D.java:140) > at > org.apache.pdfbox.rendering.font.TTFGlyph2D.getPathForCharacterCode(TTFGlyph2D.java:92) > at > org.apache.pdfbox.rendering.PageDrawer.drawGlyph2D(PageDrawer.java:392) > at org.apache.pdfbox.rendering.PageDrawer.showGlyph(PageDrawer.java:372) > at > org.apache.pdfbox.contentstream.PDFStreamEngine.showText(PDFStreamEngine.java:411) > at org.apache.pdfbox.rendering.PageDrawer.showText(PageDrawer.java:346) > at > org.apache.pdfbox.contentstream.PDFStreamEngine.showTextStrings(PDFStreamEngine.java:322) > at > org.apache.pdfbox.contentstream.operator.text.ShowTextAdjusted.process(ShowTextAdjusted.java:38) > at > org.apache.pdfbox.contentstream.PDFStreamEngine.processOperator(PDFStreamEngine.java:482) > at > org.apache.pdfbox.contentstream.PDFStreamEngine.processSubStream(PDFStreamEngine.java:236) > at > org.apache.pdfbox.contentstream.PDFStreamEngine.processSubStream(PDFStreamEngine.java:201) > at > org.apache.pdfbox.contentstream.PDFStreamEngine.processStream(PDFStreamEngine.java:155) > at org.apache.pdfbox.rendering.PageDrawer.drawPage(PageDrawer.java:177) > at > org.apache.pdfbox.rendering.PDFRenderer.renderPage(PDFRenderer.java:228) > at > org.apache.pdfbox.rendering.PDFRenderer.renderImage(PDFRenderer.java:160) > at > org.apache.pdfbox.rendering.PDFRenderer.renderImageWithDPI(PDFRenderer.java:109) -- This message was sent by Atlassian JIRA (v6.3.4#6332)