Skip to content

Panic with index out of range on some PDF files #1

@jojomi

Description

@jojomi

For several files I have seen this when using this library:

panic: runtime error: index out of range [0] with length 0

goroutine 1 [running]:
github.com/flotzilla/pdf_parser.getPreTrailerData(0xc00039b860, 0xc8, 0xc8, 0xc8, 0xc8, 0x1, 0x0, 0x0, 0x0)
        github.com/flotzilla/pdf_parser@v0.1.96/parser.go:737 +0xfd
github.com/flotzilla/pdf_parser.readXrefBlock(0xc000010118, 0x20d74, 0x1, 0x0, 0xc0000101f8, 0xc8, 0x1)
        github.com/flotzilla/pdf_parser@v0.1.96/parser.go:552 +0x67f
github.com/flotzilla/pdf_parser.readAllXrefSections(0xc000010118, 0xc000340340, 0x20d74)
        github.com/flotzilla/pdf_parser@v0.1.96/parser.go:455 +0x50

Unfortunately I can share none of the files I checked. Perhaps you can still see why this might happen?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions