Bug 708541 - Error in pdf_rearrange_pages()
Summary: Error in pdf_rearrange_pages()
Status: RESOLVED FIXED
Alias: None
Product: MuPDF
Classification: Unclassified
Component: mupdf (show other bugs)
Version: 1.26.0
Hardware: All All
: P2 normal
Assignee: MuPDF bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-05-13 16:27 UTC by Jorj
Modified: 2025-05-14 12:11 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-05-13 16:27:26 UTC
The function seems to always throw the exception "Cycle detected in outlines" for any PDF that has a table of contents.
Among failing PDFs also is the Adobe PDF specification 2008.

In PyMuPDF, we can only work with the variant pdf_rearrange_page2(doc, list, 0)
which interfaces with the original.
Comment 1 Robin Watts 2025-05-14 11:49:15 UTC
Fixed with:

commit f84bb9fbe8abea011d500d28d90e3c31c576a209
Author: Robin Watts <Robin.Watts@artifex.com>
Date:   Tue May 13 19:47:55 2025 +0100

    Bug 708541: Fix cycle detection in pdf_rearrange_pages.

    We were marking/checking an object for cycles in strip_outline,
    but we immediately call strip_outlines with it, which checks
    itself!

    Only check in strip_outlines.
Comment 2 Jorj 2025-05-14 12:11:50 UTC
Thanks for such a fast fix!