[Pkg-javascript-commits] [pdf.js] 136/157: Ensure that we don't use the same typed array for both `coords` and `colors` in Mesh `figures` (issue 6287)

David Prévot taffit at moszumanska.debian.org
Tue Aug 11 06:46:50 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 7fe2442a18bed930a560dc3595c40dc8d1d8760c
Author: Jonas Jenwald <jonas.jenwald at gmail.com>
Date:   Fri Jul 31 13:59:02 2015 +0200

    Ensure that we don't use the same typed array for both `coords` and `colors` in Mesh `figures` (issue 6287)
    
    This regressed in https://github.com/mozilla/pdf.js/commit/1e8d70af9819d9b285e15fea8d50456c8275137e.
---
 src/core/pattern.js     |  14 ++++----------
 test/pdfs/.gitignore    |   1 +
 test/pdfs/issue2948.pdf | Bin 0 -> 23038 bytes
 test/test_manifest.json |   7 +++++++
 4 files changed, 12 insertions(+), 10 deletions(-)

diff --git a/src/core/pattern.js b/src/core/pattern.js
index d3123cc..eead248 100644
--- a/src/core/pattern.js
+++ b/src/core/pattern.js
@@ -345,13 +345,10 @@ Shadings.Mesh = (function MeshClosure() {
 
       reader.align();
     }
-
-    var psPacked = new Int32Array(ps);
-
     mesh.figures.push({
       type: 'triangles',
-      coords: psPacked,
-      colors: psPacked
+      coords: new Int32Array(ps),
+      colors: new Int32Array(ps),
     });
   }
 
@@ -366,13 +363,10 @@ Shadings.Mesh = (function MeshClosure() {
       coords.push(coord);
       colors.push(color);
     }
-
-    var psPacked = new Int32Array(ps);
-
     mesh.figures.push({
       type: 'lattice',
-      coords: psPacked,
-      colors: psPacked,
+      coords: new Int32Array(ps),
+      colors: new Int32Array(ps),
       verticesPerRow: verticesPerRow
     });
   }
diff --git a/test/pdfs/.gitignore b/test/pdfs/.gitignore
index a186388..3e6cf42 100644
--- a/test/pdfs/.gitignore
+++ b/test/pdfs/.gitignore
@@ -22,6 +22,7 @@
 !simpletype3font.pdf
 !sizes.pdf
 !close-path-bug.pdf
+!issue2948.pdf
 !issue4630.pdf
 !issue4909.pdf
 !issue5202.pdf
diff --git a/test/pdfs/issue2948.pdf b/test/pdfs/issue2948.pdf
new file mode 100644
index 0000000..5eef6c6
Binary files /dev/null and b/test/pdfs/issue2948.pdf differ
diff --git a/test/test_manifest.json b/test/test_manifest.json
index 5ecd5b7..5269624 100644
--- a/test/test_manifest.json
+++ b/test/test_manifest.json
@@ -634,6 +634,13 @@
        "rounds": 1,
        "type": "eq"
     },
+    {  "id": "issue2948",
+       "file": "pdfs/issue2948.pdf",
+       "md5": "26210bed6a57d5466042aff22f0249f0",
+       "link": false,
+       "rounds": 1,
+       "type": "eq"
+    },
     {  "id": "usmanm-bad-auto-fetch",
        "file": "pdfs/usmanm-bad.pdf",
        "md5": "38afb822433aaf07fc8f54807cd4f61a",

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