]> git.parisson.com Git - pdf.js.git/commitdiff
Fix shavian.pdf regression and related optimization
authornotmasteryet <async.processingjs@yahoo.com>
Thu, 25 Aug 2011 00:08:23 +0000 (19:08 -0500)
committernotmasteryet <async.processingjs@yahoo.com>
Thu, 25 Aug 2011 00:08:23 +0000 (19:08 -0500)
pdf.js

diff --git a/pdf.js b/pdf.js
index 41445533c80029ed4449a389c08f098ba66d4414..d470ef067c01743a85e68c72e05fa2d63e10609e 100644 (file)
--- a/pdf.js
+++ b/pdf.js
@@ -208,6 +208,11 @@ var DecodeStream = (function() {
           this.readBlock();
 
         var end = this.bufferLength;
+
+        // checking if bufferLength is still 0 then
+        // the buffer has to be initialized
+        if (!end)
+          this.buffer = new Uint8Array(0);
       }
 
       this.pos = end;
@@ -3340,11 +3345,11 @@ var Page = (function() {
       var xref = this.xref;
       var content = xref.fetchIfRef(this.content);
       var resources = xref.fetchIfRef(this.resources);
-      if (IsArray(this.content)) {
+      if (IsArray(content)) {
         // fetching items
         var i, n = content.length;
         for (i = 0; i < n; ++i)
-          content[i] = xref.fetchIfRef(this.content[i]);
+          content[i] = xref.fetchIfRef(content[i]);
         content = new StreamsSequenceStream(content);
       }
       this.code = gfx.compile(content, xref, resources, fonts, images);