Skip to content

Apply redactions at the mark’s current position in a layer - #137

Merged
bobsingor merged 1 commit into
embedpdf/mainfrom
codex/redaction-layer-view
Nov 29, 2026
Merged

bobsingor merged 1 commit into
embedpdf/mainfrom
codex/redaction-layer-view

Conversation

@bobsingor

Copy link
Copy Markdown
Contributor

Fix

Applying a redaction could read a mark’s original rectangle from the base document after the mark had moved in a layer. In debug builds, resolving those references could also trip the document-view assertion.

Keep the page’s active view in scope throughout EPDFPage_ApplyRedactions, including mark selection and content removal. Both previously expected layer-mode crashes now pass and have been removed from the exceptions list.

Regression test

Move a redaction mark from KEEP to REMOVE in one layer transaction and apply it in the next. Save a full copy, reopen it, and check that only KEEP can be extracted and that REMOVE is absent from the PDF’s reachable objects, including decoded streams. Run the same scenario for a selected mark and for applying all marks.

Verification on macOS arm64

  • All 1,412 debug unit tests passed.
  • In the redaction and content-rewrite suites, 211 tests passed in each of plain and layer mode. One transaction-only case skipped its plain-document parameter in each run. The observed layer writer counts matched the checked-in expectations.
  • The strict fork-tag check and the C API check passed.
  • The new regression and both former layer-mode crashes passed in a release build.

@bobsingor
bobsingor merged commit 65345f1 into embedpdf/main Nov 29, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant