Skip to content

Commit f06d0b2

Browse files
authored
Merge pull request #16483 from calixteman/bug1529502
[OTS] Remove cntrmask instruction with no stem in charstring (bug 1529502)
2 parents 60feb2d + 78e6020 commit f06d0b2

File tree

4 files changed

+15
-0
lines changed

4 files changed

+15
-0
lines changed

src/core/cff_parser.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -546,6 +546,13 @@ class CFFParser {
546546
stackSize++;
547547
} else if (value === 19 || value === 20) {
548548
state.hints += stackSize >> 1;
549+
if (state.hints === 0) {
550+
// Not a valid value (see bug 1529502): just remove it.
551+
data.copyWithin(j - 1, j, -1);
552+
j -= 1;
553+
length -= 1;
554+
continue;
555+
}
549556
// skipping right amount of hints flag data
550557
j += (state.hints + 7) >> 3;
551558
stackSize %= 2;

test/pdfs/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -595,3 +595,4 @@
595595
!bug1825002.pdf
596596
!issue14755.pdf
597597
!issue16473.pdf
598+
!bug1529502.pdf

test/pdfs/bug1529502.pdf

41.7 KB
Binary file not shown.

test/test_manifest.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7676,5 +7676,12 @@
76767676
"link": true,
76777677
"forms": true,
76787678
"type": "eq"
7679+
},
7680+
{
7681+
"id": "bug1529502",
7682+
"file": "pdfs/bug1529502.pdf",
7683+
"md5": "4830e765a3d6cb64d39b84de11178f6e",
7684+
"rounds": 1,
7685+
"type": "eq"
76797686
}
76807687
]

0 commit comments

Comments
 (0)