1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-20 15:18:08 +02:00

Fix canvas state getting out of sync from smasks. (bug 1755507)

Soft masks can be enabled/disabled at anytime and at different
points in the save/restore stack. This can lead to
the amount of save/restores becoming unbalanced across the
two canvases. Instead of save/restoring on the temporary canvas
change it so we only track state on the main (suspended canvas).

I was also getting an out balance stack from patterns, so I've also
fixed that and added a warning that will at least show up on chrome.
It would be nice to add this so Firefox at some point too.

Fixes #11328, #14297 and bug 1755507
This commit is contained in:
Brendan Dahl 2022-02-15 16:44:50 -08:00
parent f8b2a99ddc
commit 7def6d12c8
6 changed files with 57 additions and 21 deletions

View file

@ -175,6 +175,7 @@
!issue8565.pdf
!clippath.pdf
!issue8795_reduced.pdf
!bug1755507.pdf
!close-path-bug.pdf
!issue6019.pdf
!issue6621.pdf
@ -491,6 +492,7 @@
!pr12564.pdf
!pr12828.pdf
!secHandler.pdf
!issue14297.pdf
!rc_annotation.pdf
!issue14267.pdf
!PDFBOX-4352-0.pdf

BIN
test/pdfs/bug1755507.pdf Normal file

Binary file not shown.

BIN
test/pdfs/issue14297.pdf Normal file

Binary file not shown.

View file

@ -2157,6 +2157,12 @@
"type": "eq",
"about": "Glyph that gets mapped to unicode non-breaking-space."
},
{ "id": "issue14297",
"file": "pdfs/issue14297.pdf",
"md5": "46eb3d4d4bc47c8009fc4c699d213a18",
"rounds": 1,
"type": "eq"
},
{ "id": "simpletype3font",
"file": "pdfs/simpletype3font.pdf",
"md5": "b374c7543920840c61999e9e86939f99",
@ -2506,6 +2512,12 @@
"lastPage": 2,
"type": "eq"
},
{ "id": "bug1755507",
"file": "pdfs/bug1755507.pdf",
"md5": "319d73b8fd680cdc583d69b7f7ab29e9",
"rounds": 1,
"type": "eq"
},
{ "id": "issue9367",
"file": "pdfs/issue9367.pdf",
"md5": "81a2c6f1fe5d1bb00ff0479aa6547155",