1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-25 17:48:07 +02:00

Avoiding 'pc is undefined' failures

This commit is contained in:
Yury Delendik 2013-10-30 10:54:19 -05:00
parent aeab4a139f
commit 83e17c2953
3 changed files with 19 additions and 0 deletions

View file

@ -3507,6 +3507,11 @@ var Font = (function FontClosure() {
callstack.push({data: data, i: i, stackTop: stack.length - 1});
functionsCalled.push(funcId);
var pc = ttContext.functionsDefined[funcId];
if (!pc) {
warn('TT: CALL non-existent function');
ttContext.hintsValid = false;
return;
}
data = pc.data;
i = pc.i;
}
@ -3527,6 +3532,11 @@ var Font = (function FontClosure() {
lastEndf = i;
} else {
var pc = callstack.pop();
if (!pc) {
warn('TT: ENDF bad stack');
ttContext.hintsValid = false;
return;
}
var funcId = functionsCalled.pop();
data = pc.data;
i = pc.i;