[Pkg-javascript-commits] [pdf.js] 21/106: Ensure that the cmap position is within the bounds of the font file in |readCmapTable|

David Prévot taffit at moszumanska.debian.org
Sat Jun 20 21:33:45 UTC 2015


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository pdf.js.

commit 70b839386af7a0fb089da07dc15f072a3cc79d86
Author: Jonas Jenwald <jonas.jenwald at gmail.com>
Date:   Thu Apr 2 15:31:21 2015 +0200

    Ensure that the cmap position is within the bounds of the font file in |readCmapTable|
---
 src/core/fonts.js | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/core/fonts.js b/src/core/fonts.js
index 751183a..a22e7a1 100644
--- a/src/core/fonts.js
+++ b/src/core/fonts.js
@@ -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();

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/pdf.js.git



More information about the Pkg-javascript-commits mailing list