From 9b4ca246e4ab63bdf8a8ee2ea35d1a5153ace906 Mon Sep 17 00:00:00 2001 From: Yury Delendik Date: Thu, 16 May 2013 08:56:22 -0500 Subject: [PATCH] Ensure we don't modify the original PDF data when sanitizing TrueType --- src/fonts.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/fonts.js b/src/fonts.js index e86be2d20..22d2a1cd9 100644 --- a/src/fonts.js +++ b/src/fonts.js @@ -3870,6 +3870,9 @@ var Font = (function FontClosure() { } } + // The following steps modify the original font data, making copy + font = new Stream(new Uint8Array(font.getBytes())); + // Check that required tables are present var requiredTables = ['OS/2', 'cmap', 'head', 'hhea', 'hmtx', 'maxp', 'name', 'post'];