Ensure that the cmap position is within the bounds of the font file in |readCmapTable|
This commit is contained in:
parent
d484ebd492
commit
70b839386a
@ -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…
Reference in New Issue
Block a user