[OTS] Remove cntrmask instruction with no stem in charstring (bug 1529502)

This commit is contained in:
Calixte Denizet 2023-05-28 17:47:04 +02:00
parent 6d8810b55c
commit 78e6020a6e
4 changed files with 15 additions and 0 deletions

View File

@ -546,6 +546,13 @@ class CFFParser {
stackSize++; stackSize++;
} else if (value === 19 || value === 20) { } else if (value === 19 || value === 20) {
state.hints += stackSize >> 1; state.hints += stackSize >> 1;
if (state.hints === 0) {
// Not a valid value (see bug 1529502): just remove it.
data.copyWithin(j - 1, j, -1);
j -= 1;
length -= 1;
continue;
}
// skipping right amount of hints flag data // skipping right amount of hints flag data
j += (state.hints + 7) >> 3; j += (state.hints + 7) >> 3;
stackSize %= 2; stackSize %= 2;

View File

@ -595,3 +595,4 @@
!bug1825002.pdf !bug1825002.pdf
!issue14755.pdf !issue14755.pdf
!issue16473.pdf !issue16473.pdf
!bug1529502.pdf

BIN
test/pdfs/bug1529502.pdf Normal file

Binary file not shown.

View File

@ -7676,5 +7676,12 @@
"link": true, "link": true,
"forms": true, "forms": true,
"type": "eq" "type": "eq"
},
{
"id": "bug1529502",
"file": "pdfs/bug1529502.pdf",
"md5": "4830e765a3d6cb64d39b84de11178f6e",
"rounds": 1,
"type": "eq"
} }
] ]