[Pkg-javascript-commits] [pdf.js] 165/174: Ignore the /Mask entry in images unless its /ImageMask entry is explicitly set to `true` (issue 6621)
David Prévot
taffit at moszumanska.debian.org
Thu Nov 19 18:45:43 UTC 2015
This is an automated email from the git hooks/post-receive script.
taffit pushed a commit to branch master
in repository pdf.js.
commit 50a70429ecd6e8be8b9a7f39933dab4cec4b2be4
Author: Jonas Jenwald <jonas.jenwald at gmail.com>
Date: Thu Nov 12 21:41:16 2015 +0100
Ignore the /Mask entry in images unless its /ImageMask entry is explicitly set to `true` (issue 6621)
Fixes 6621.
---
src/core/image.js | 7 ++++++-
test/pdfs/.gitignore | 1 +
test/pdfs/issue6621.pdf | Bin 0 -> 14521 bytes
test/test_manifest.json | 7 +++++++
4 files changed, 14 insertions(+), 1 deletion(-)
diff --git a/src/core/image.js b/src/core/image.js
index 5f3aa6c..2d1f9d6 100644
--- a/src/core/image.js
+++ b/src/core/image.js
@@ -140,7 +140,12 @@ var PDFImage = (function PDFImageClosure() {
this.smask = new PDFImage(xref, res, smask, false);
} else if (mask) {
if (isStream(mask)) {
- this.mask = new PDFImage(xref, res, mask, false, null, null, true);
+ var maskDict = mask.dict, imageMask = maskDict.get('ImageMask', 'IM');
+ if (!imageMask) {
+ warn('Ignoring /Mask in image without /ImageMask.');
+ } else {
+ this.mask = new PDFImage(xref, res, mask, false, null, null, true);
+ }
} else {
// Color key mask (just an array).
this.mask = mask;
diff --git a/test/pdfs/.gitignore b/test/pdfs/.gitignore
index d47a465..05d5598 100644
--- a/test/pdfs/.gitignore
+++ b/test/pdfs/.gitignore
@@ -32,6 +32,7 @@
!issue3879r.pdf
!close-path-bug.pdf
!issue6019.pdf
+!issue6621.pdf
!issue1293r.pdf
!issue6541.pdf
!issue2948.pdf
diff --git a/test/pdfs/issue6621.pdf b/test/pdfs/issue6621.pdf
new file mode 100644
index 0000000..ea3cd73
Binary files /dev/null and b/test/pdfs/issue6621.pdf differ
diff --git a/test/test_manifest.json b/test/test_manifest.json
index cce0659..15720a0 100644
--- a/test/test_manifest.json
+++ b/test/test_manifest.json
@@ -732,6 +732,13 @@
"rounds": 1,
"type": "load"
},
+ { "id": "issue6621",
+ "file": "pdfs/issue6621.pdf",
+ "md5": "8079ce514fb2cdded4251eade6380ba9",
+ "link": false,
+ "rounds": 1,
+ "type": "eq"
+ },
{ "id": "scan-bad",
"file": "pdfs/scan-bad.pdf",
"md5": "4cf988f01ab83f61aca57f406dfd6584",
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/pdf.js.git
More information about the Pkg-javascript-commits
mailing list