Skip to content

xref table circular references causing stack-overflow on watermark and optimize #1334

@manfredleka

Description

@manfredleka

Hi !
First of all thanks for the work on this lib which proves very useful !

Now, using pdfcpu on a production service to watermark documents, sometimes the library experiences stack-overflow issues.
I can't provide an actual document causing the issue for confidentiality reasons but I managed to recreate a minimal pdf reproducing the error (here-attached)

Steps to reproduce

  • on provided pdf containing circular references, try either optimize or watermark functions

Issue

  • library is stuck in the circular references and triggers a stack overflow error

I have been working on a fix suggestion i'll attach to the issue shortly

Thank you for submitting a possible bug!

Please ensure the following:

  • Your issue is based on the latest commit
  • State your OS and OS version
    macos, sequoia 15.3.2
  • When reporting a problem with a specific PDF input file please avoid stating the organization responsible for the PDFWriter - just refer to the PDFWriter
    k

circular_ref_test.pdf

Metadata

Metadata

Assignees

Type

No type
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