mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-22 16:18:08 +02:00
Merge pull request #17674 from calixteman/issue17671
Fix the endoffset of the last glyph when it's followed by a null offset in the loca table
This commit is contained in:
commit
a83a8d7e4f
4 changed files with 16 additions and 0 deletions
|
@ -2117,6 +2117,14 @@ class Font {
|
|||
break;
|
||||
}
|
||||
|
||||
// If the last offset is 0 in the loca table then we can't compute the
|
||||
// endOffset for the last glyph. So in such a case we set the endOffset
|
||||
// to the end of the data (fixes issue #17671).
|
||||
const last = locaEntries.at(-2);
|
||||
if (last.offset !== 0 && last.endOffset === 0) {
|
||||
last.endOffset = oldGlyfDataLength;
|
||||
}
|
||||
|
||||
const missingGlyphs = Object.create(null);
|
||||
let writeOffset = 0;
|
||||
itemEncode(locaData, 0, writeOffset);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue