Skip to content

NPE in StreamBasedCMap.addRange #16

Description

@mhitkax

We are using JPod 2.0 for extracting text from PDF files. This is working reasonably well, but recently we started encountering one specific error more and more:

de.intarsys.pdf.content.CSError: unexpected exception
    at de.intarsys.pdf.content.CSInterpreter.process(CSInterpreter.java:213) ~[jpod-2.0.jar:?]
    at de.intarsys.pdf.content.CSDeviceBasedInterpreter.process(CSDeviceBasedInterpreter.java:187) ~[jpod-2.0.jar:?]
    at de.intarsys.pdf.content.CSDeviceAdapter.doForm(CSDeviceAdapter.java:161) ~[jpod-2.0.jar:?]
    at de.intarsys.pdf.content.CSDeviceAdapter.doXObject(CSDeviceAdapter.java:202) ~[jpod-2.0.jar:?]
    at de.intarsys.pdf.content.CSDeviceBasedInterpreter.render_Do(CSDeviceBasedInterpreter.java:324) ~[jpod-2.0.jar:?]
    at de.intarsys.pdf.content.CSInterpreter.process(CSInterpreter.java:450) ~[jpod-2.0.jar:?]
    at de.intarsys.pdf.content.CSInterpreter.process(CSInterpreter.java:207) ~[jpod-2.0.jar:?]
    at de.intarsys.pdf.content.CSDeviceBasedInterpreter.process(CSDeviceBasedInterpreter.java:187) ~[jpod-2.0.jar:?]
    ...
Caused by: java.lang.ArrayIndexOutOfBoundsException: 4
    at de.intarsys.pdf.font.StreamBasedCMap.addRange(StreamBasedCMap.java:124) ~[jpod-2.0.jar:?]
    at de.intarsys.pdf.font.StreamBasedCMap.do_endcodespacerange(StreamBasedCMap.java:336) ~[jpod-2.0.jar:?]
    at de.intarsys.pdf.font.StreamBasedCMap.initializeFromOperation(StreamBasedCMap.java:509) ~[jpod-2.0.jar:?]
    at de.intarsys.pdf.font.StreamBasedCMap.initializeFromContent(StreamBasedCMap.java:477) ~[jpod-2.0.jar:?]
    at de.intarsys.pdf.font.InternalCMap.initializeFromCos(InternalCMap.java:34) ~[jpod-2.0.jar:?]
    at de.intarsys.pdf.cos.COSBasedObject$MetaClass.createFromCos(COSBasedObject.java:96) ~[jpod-2.0.jar:?]
    at de.intarsys.pdf.font.PDFontType0.getCMap(PDFontType0.java:107) ~[jpod-2.0.jar:?]
    at de.intarsys.pdf.font.PDFontType0.getNextGlyphsEncoded(PDFontType0.java:183) ~[jpod-2.0.jar:?]
    at de.intarsys.pdf.content.CSBasicDevice.textShow(CSBasicDevice.java:471) ~[jpod-2.0.jar:?]
    at de.intarsys.pdf.content.CSDeviceBasedInterpreter.render_TJ(CSDeviceBasedInterpreter.java:752) ~[jpod-2.0.jar:?]
    at de.intarsys.pdf.content.CSInterpreter.process(CSInterpreter.java:236) ~[jpod-2.0.jar:?]
    at de.intarsys.pdf.content.CSInterpreter.process(CSInterpreter.java:207) ~[jpod-2.0.jar:?]
    ... 24 more

I cannot share the problematic documents, but we can test any potential fix with those documents. Any pointers on what might be the problem/fix would be highly appreciated.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions