mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-22 16:18:08 +02:00
Ensure that the cmap position is within the bounds of the font file in |readCmapTable|
This commit is contained in:
parent
d484ebd492
commit
70b839386a
1 changed files with 4 additions and 2 deletions
|
@ -3250,7 +3250,10 @@ var Font = (function FontClosure() {
|
|||
}
|
||||
}
|
||||
|
||||
if (!potentialTable) {
|
||||
if (potentialTable) {
|
||||
font.pos = start + potentialTable.offset;
|
||||
}
|
||||
if (!potentialTable || font.peekByte() === -1) {
|
||||
warn('Could not find a preferred cmap table.');
|
||||
return {
|
||||
platformId: -1,
|
||||
|
@ -3260,7 +3263,6 @@ var Font = (function FontClosure() {
|
|||
};
|
||||
}
|
||||
|
||||
font.pos = start + potentialTable.offset;
|
||||
var format = font.getUint16();
|
||||
var length = font.getUint16();
|
||||
var language = font.getUint16();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue