]> git.parisson.com Git - pdf.js.git/commitdiff
Ensure lastChar is correct if it's not specified
authorVivien Nicolas <21@vingtetun.org>
Wed, 31 Aug 2011 01:31:45 +0000 (03:31 +0200)
committerVivien Nicolas <21@vingtetun.org>
Wed, 31 Aug 2011 01:31:45 +0000 (03:31 +0200)
pdf.js

diff --git a/pdf.js b/pdf.js
index d97588c2c3eed5503dabd74503f64d7ef6d56747..b3ff32aa86759397a2f5316838eec8df567b69d3 100644 (file)
--- a/pdf.js
+++ b/pdf.js
@@ -4284,9 +4284,12 @@ var PartialEvaluator = (function() {
         // firstChar and width are required
         // (except for 14 standard fonts)
         var firstChar = xref.fetchIfRef(fontDict.get('FirstChar')) || 0;
-        var lastChar = xref.fetchIfRef(fontDict.get('LastChar')) || 0;
         var widths = xref.fetchIfRef(fontDict.get('Widths')) || [];
 
+        var lastChar = xref.fetchIfRef(fontDict.get('LastChar'));
+        if (!lastChar)
+          lastChar = diffEncoding.length || baseEncoding.length;
+
         // merge in the differences
         var glyphsMap = {};
         for (var i = firstChar; i <= lastChar; i++) {