Skip to content

[Bug]: pdf.js busy-loops forever on JBIG2 image that uses the symbol dictionary context retain/reuse feature #20461

@nico

Description

@nico

Attach (recommended) or Link to PDF file

bitmap-symbol-context-reuse.pdf

Web browser and its version

Firefox 145.0

Operating system and its version

macOS 15.6.1

PDF.js version

Whatever is in the latest firefox

Is the bug present in the latest PDF.js version?

Yes

Is a browser extension

No

Steps to reproduce the problem

Open file above.

What is the expected behavior?

Renders fine (or fails to render).

What went wrong?

Spins forever, keeping one core at 100%

Link to a viewer

No response

Additional context

This is a synthetic test case. SerenityOS/serenity#26419 has some more details on it. The json file in SerenityOS/serenity@38ebe68 shows the file contents.

Since this file only uses up to 3 referred-to segments, I believe this is a different bug than #20439.

The file was written by a tool I wrote, and it's possible that the bitstream is somehow off. However, PDFium and Acrobat Reader can both decode it fine. (And even if it's not decoded fine, it at least shouldn't busy-loop.)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions