mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-22 16:18:08 +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:
commit
23b6fde9fc
4 changed files with 16 additions and 0 deletions
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue