1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-26 01:58:06 +02:00

Merge pull request #14464 from Snuffleupagus/issue-14462

Support Type1 font files with incomplete /CharStrings definitions (issue 14462)
This commit is contained in:
Tim van der Meij 2022-01-19 20:38:46 +01:00 committed by GitHub
commit 23b6fde9fc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 16 additions and 0 deletions

View file

@ -512,6 +512,11 @@ const Type1Parser = (function Type1ParserClosure() {
return (this.currentChar = this.stream.getByte());
}
prevChar() {
this.stream.skip(-2);
return (this.currentChar = this.stream.getByte());
}
getToken() {
// Eat whitespace and comments.
let comment = false;
@ -604,6 +609,10 @@ const Type1Parser = (function Type1ParserClosure() {
token = this.getToken(); // read in 'ND' or '|-'
if (token === "noaccess") {
this.getToken(); // read in 'def'
} else if (token === "/") {
// The expected 'ND' or '|-' token is missing, avoid swallowing
// the start of the next glyph (fixes issue14462_reduced.pdf).
this.prevChar();
}
charstrings.push({
glyph,