]> git.parisson.com Git - pdf.js.git/commitdiff
Ignore previously parsed xref streams
author= <=>
Wed, 21 Sep 2011 17:04:21 +0000 (10:04 -0700)
committer= <=>
Wed, 21 Sep 2011 17:04:21 +0000 (10:04 -0700)
pdf.js
test/pdfs/f1040.pdf.link [new file with mode: 0644]
test/test_manifest.json

diff --git a/pdf.js b/pdf.js
index 224becdf1eab56fd86633f3bf261dd5e6391867b..9a0b0977a277d4c588664824347682065a90574e 100644 (file)
--- a/pdf.js
+++ b/pdf.js
@@ -3094,10 +3094,11 @@ var XRef = (function() {
       // check for 'XRefStm' key
       if (IsInt(obj = dict.get('XRefStm'))) {
         var pos = obj;
-        if (pos in this.xrefstms)
-          error('Invalid XRef table');
-        this.xrefstms[pos] = 1; // avoid infinite recursion
-        this.readXRef(pos);
+        // ignore previously loaded xref streams (possible infinite recursion)
+        if (!(pos in this.xrefstms)) {
+          this.xrefstms[pos] = 1;
+          this.readXRef(pos);
+        }
       }
 
       return dict;
diff --git a/test/pdfs/f1040.pdf.link b/test/pdfs/f1040.pdf.link
new file mode 100644 (file)
index 0000000..a3299fc
--- /dev/null
@@ -0,0 +1 @@
+http://www.irs.gov/pub/irs-pdf/f1040.pdf
index a3115764a3d0bee1a04c82689a0ad2fd05d19666..edf13b7c58a8505cba7a66f6b17b4b4caa9a1623 100644 (file)
        "link": true,
        "rounds": 1,
        "type": "load"
+    },
+    {  "id": "f1040",
+       "file": "pdfs/f1040.pdf",
+       "link": true,
+       "rounds": 1,
+       "type": "load"
     }
 ]