[Pkg-javascript-commits] [pdf.js] 27/174: Prevent `PartialEvaluator_buildFormXObject` from failing if the `Matrix` or `BBox` contains indirect objects

David Prévot taffit at moszumanska.debian.org
Thu Nov 19 18:45:02 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 1b8cb5255508f8d719fd16f19fc1fcb3fc035ba1
Author: Jonas Jenwald <jonas.jenwald at gmail.com>
Date:   Mon Sep 28 15:09:24 2015 +0200

    Prevent `PartialEvaluator_buildFormXObject` from failing if the `Matrix` or `BBox` contains indirect objects
    
    This patch fixes yet another instance of bad PDF data, specifically a case where the `BBox` array contains indirect objects (i.e. `Ref`s).
    
    Fixes the missing image in http://www.int.washington.edu/talks/WorkShops/int_08_37W/People/Franz_M/Franz.pdf#page=24. *Note:* There are missing images on a number of the pages in that file.
---
 src/core/evaluator.js   |   4 ++--
 test/pdfs/.gitignore    |   1 +
 test/pdfs/franz_2.pdf   | Bin 0 -> 2828 bytes
 test/test_manifest.json |   8 ++++++++
 4 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/src/core/evaluator.js b/src/core/evaluator.js
index 3e0a98d..dcba0e0 100644
--- a/src/core/evaluator.js
+++ b/src/core/evaluator.js
@@ -126,8 +126,8 @@ var PartialEvaluator = (function PartialEvaluatorClosure() {
                                                                  xobj, smask,
                                                                  operatorList,
                                                                  initialState) {
-      var matrix = xobj.dict.get('Matrix');
-      var bbox = xobj.dict.get('BBox');
+      var matrix = xobj.dict.getArray('Matrix');
+      var bbox = xobj.dict.getArray('BBox');
       var group = xobj.dict.get('Group');
       if (group) {
         var groupOptions = {
diff --git a/test/pdfs/.gitignore b/test/pdfs/.gitignore
index 842c2d3..de2d8b7 100644
--- a/test/pdfs/.gitignore
+++ b/test/pdfs/.gitignore
@@ -3,6 +3,7 @@
 
 !tracemonkey.pdf
 !franz.pdf
+!franz_2.pdf
 !issue2391-1.pdf
 !issue2391-2.pdf
 !issue5801.pdf
diff --git a/test/pdfs/franz_2.pdf b/test/pdfs/franz_2.pdf
new file mode 100644
index 0000000..ac1219c
Binary files /dev/null and b/test/pdfs/franz_2.pdf differ
diff --git a/test/test_manifest.json b/test/test_manifest.json
index adbcd5a..834e431 100644
--- a/test/test_manifest.json
+++ b/test/test_manifest.json
@@ -527,6 +527,14 @@
        "type": "eq",
        "about": "Type1 font with |Ref|s in the Differences array of the Encoding dictionary."
     },
+    {  "id": "franz_2",
+       "file": "pdfs/franz_2.pdf",
+       "md5": "9d301ed8816e879891115b5cc3c39559",
+       "link": false,
+       "rounds": 1,
+       "type": "eq",
+       "about": "XObject with BBox array containing indirect object."
+    },
     {  "id": "issue4934",
        "file": "pdfs/issue4934.pdf",
        "md5": "6099da44f677702ae65a648b51a2226d",

-- 
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