From adca8d4291fbaab0c74719ed40a9219d8f9dfb55 Mon Sep 17 00:00:00 2001 From: Yury Delendik Date: Sun, 2 Mar 2014 15:40:48 -0600 Subject: [PATCH] Rejects invalid fpgm table when too many functions --- src/core/fonts.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/core/fonts.js b/src/core/fonts.js index 1d92856fa..2b47e005d 100644 --- a/src/core/fonts.js +++ b/src/core/fonts.js @@ -3707,6 +3707,11 @@ var Font = (function FontClosure() { if (ttContext.tooComplexToFollowFunctions) { return; } + if (ttContext.functionsDefined.length > maxFunctionDefs) { + warn('TT: more functions defined than expected'); + ttContext.hintsValid = false; + return; + } for (var j = 0, jj = ttContext.functionsUsed.length; j < jj; j++) { if (j > maxFunctionDefs) { warn('TT: invalid function id: ' + j);