mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-22 16:18:08 +02:00
Merge pull request #3883 from yurydelendik/bug904941
Fixes invalid maxZones value
This commit is contained in:
commit
558b722757
1 changed files with 8 additions and 1 deletions
|
@ -3729,7 +3729,14 @@ var Font = (function FontClosure() {
|
|||
var numGlyphs = int16(font.getBytes(2));
|
||||
var maxFunctionDefs = 0;
|
||||
if (version >= 0x00010000 && tables.maxp.length >= 22) {
|
||||
font.pos += 14;
|
||||
// maxZones can be invalid
|
||||
font.pos += 8;
|
||||
var maxZones = int16(font.getBytes(2));
|
||||
if (maxZones > 2) { // reset to 2 if font has invalid maxZones
|
||||
tables.maxp.data[14] = 0;
|
||||
tables.maxp.data[15] = 2;
|
||||
}
|
||||
font.pos += 4;
|
||||
maxFunctionDefs = int16(font.getBytes(2));
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue