Merge pull request #14815 from Snuffleupagus/issue-14814

Ignore non-Stream /SMask-entries when parsing images (issue 14814)
This commit is contained in:
Tim van der Meij 2022-04-22 11:39:13 +02:00 committed by GitHub
commit f39219cd45
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 14 additions and 2 deletions

View File

@ -275,12 +275,16 @@ class PDFImage {
const mask = image.dict.get("Mask");
if (smask) {
smaskData = smask;
if (smask instanceof BaseStream) {
smaskData = smask;
} else {
warn("Unsupported /SMask format.");
}
} else if (mask) {
if (mask instanceof BaseStream || Array.isArray(mask)) {
maskData = mask;
} else {
warn("Unsupported mask format.");
warn("Unsupported /Mask format.");
}
}

View File

@ -505,6 +505,7 @@
!poppler-85140-0.pdf
!poppler-395-0-fuzzed.pdf
!GHOSTSCRIPT-698804-1-fuzzed.pdf
!issue14814.pdf
!poppler-91414-0-53.pdf
!poppler-91414-0-54.pdf
!poppler-742-0-fuzzed.pdf

BIN
test/pdfs/issue14814.pdf Normal file

Binary file not shown.

View File

@ -98,6 +98,13 @@
"rounds": 1,
"type": "eq"
},
{ "id": "issue14814",
"file": "pdfs/issue14814.pdf",
"md5": "a1c8b677335ff5ea0d07e35e7dffb6e8",
"rounds": 1,
"firstPage": 2,
"type": "eq"
},
{ "id": "issue14269",
"file": "pdfs/issue14269.pdf",
"md5": "f34abf77a418f54e13fbcd03b063432e",