Summary: | Non-Detection of unbalanced "q"/"Q" graphics operators | ||
---|---|---|---|
Product: | MuPDF | Reporter: | Jorj <jorj.x.mckie> |
Component: | mupdf | Assignee: | MuPDF bugs <mupdf-bugs> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | robin.watts, sebastian.rasmussen |
Priority: | P2 | ||
Version: | unspecified | ||
Hardware: | All | ||
OS: | All | ||
Customer: | Word Size: | --- |
Description
Jorj
2025-03-28 14:00:41 UTC
This is because the pdf interpreter mechanism automatically inserts extra pops as required. I'll think ways to fix it. Fix in testing: https://cgit.ghostscript.com/cgi-bin/cgit.cgi/user/robin/mupdf.git/commit/?h=pending&id=a9f6fc77d794f1cefac811c6e73c3352dfa5750b If I don't get to commit it before I go on holiday, then maybe the others can? Confirming that the issue has been correctly fixed, see comment https://github.com/pymupdf/PyMuPDF/issues/4415#issuecomment-2763595019 Fixed in commit b660c49195081d8bc2766079d261dbbb1eeb08ef Author: Robin Watts <Robin.Watts@artifex.com> Date: Fri Mar 28 19:23:42 2025 +0000 Bug 708393: Fix pdf_count_q_balance. pdf_count_q_balance relies on counting q and Q operations to detect mismatches. Unfortunately, it does this by running the standard PDF interpretation mechanisms, and these attempt to autocorrect for missing Q's at the end of a page. This autocorrection affects our reading. Insert a new processor event that happens before the auto correction, and use that so that pdf_count_q_balance can get the uncorrected values. |