Bug 708373 - layer/clip nesting too deep
Summary: layer/clip nesting too deep
Status: RESOLVED FIXED
Alias: None
Product: MuPDF
Classification: Unclassified
Component: mupdf (show other bugs)
Version: unspecified
Hardware: All All
: P2 normal
Assignee: MuPDF bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-03-25 13:26 UTC by Jorj
Modified: 2025-03-27 10:47 UTC (History)
1 user (show)

See Also:
Customer:
Word Size: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jorj 2025-03-25 13:26:11 UTC
PyMuPDF issue: https://github.com/pymupdf/PyMuPDF/issues/4403
Problem file: https://github.com/user-attachments/files/19448199/subset.pdf

Almost all viewers exhibit an extended response time.
This is the output of mutool draw:

$ mutool draw -o test.txt subset.pdf
warning: dropping unclosed PDF processor
limit error: layer/clip nesting too deep
cannot draw 'subset.pdf'

Anything that can be / should be done here?
Comment 1 Robin Watts 2025-03-26 14:47:47 UTC
Fixed with:

commit 0d48b70f9970c77d133d31a070f437cea70f067bAuthor: Robin Watts <Robin.Watts@artifex.com>
Date:   Wed Mar 26 13:08:16 2025 +0000

    Bug 708373: Record clip/layer nesting more efficiently.

    The file in question uses multiple (1000+!) nested clip regions.
    This was running us off the fixed size array. We now store a
    count of clips at each level rather than 1 per level to avoid
    this.

It is an obscenely structured file, with 1000s of nested (non rectangular) clips.
Comment 2 Jorj 2025-03-27 10:47:45 UTC
Confirming that this fix resolves the issue! See PyMuPDF post https://github.com/pymupdf/PyMuPDF/issues/4403#issuecomment-2757572934