[Pkg-javascript-commits] [pdf.js] 374/414: Ensure that the `params` parameter of the `PredictorStream` is a dictionary (issue 7200)
David Prévot
taffit at moszumanska.debian.org
Tue Jun 28 17:12:41 UTC 2016
This is an automated email from the git hooks/post-receive script.
taffit pushed a commit to branch master
in repository pdf.js.
commit 079b563e2d2f998b970b53e32755de89f6ed1684
Author: Jonas Jenwald <jonas.jenwald at gmail.com>
Date: Fri Apr 15 14:22:36 2016 +0200
Ensure that the `params` parameter of the `PredictorStream` is a dictionary (issue 7200)
Fixes 7200.
---
src/core/stream.js | 4 ++++
test/pdfs/.gitignore | 1 +
test/pdfs/issue7200.pdf | Bin 0 -> 37095 bytes
test/test_manifest.json | 7 +++++++
4 files changed, 12 insertions(+)
diff --git a/src/core/stream.js b/src/core/stream.js
index 7fd0924..42d9ee9 100644
--- a/src/core/stream.js
+++ b/src/core/stream.js
@@ -39,6 +39,7 @@ var createObjectURL = sharedUtil.createObjectURL;
var shadow = sharedUtil.shadow;
var warn = sharedUtil.warn;
var Dict = corePrimitives.Dict;
+var isDict = corePrimitives.isDict;
var Jbig2Image = coreJbig2.Jbig2Image;
var JpegImage = coreJpg.JpegImage;
var JpxImage = coreJpx.JpxImage;
@@ -680,6 +681,9 @@ var FlateStream = (function FlateStreamClosure() {
var PredictorStream = (function PredictorStreamClosure() {
function PredictorStream(str, maybeLength, params) {
+ if (!isDict(params)) {
+ return str; // no prediction
+ }
var predictor = this.predictor = params.get('Predictor') || 1;
if (predictor <= 1) {
diff --git a/test/pdfs/.gitignore b/test/pdfs/.gitignore
index 6fd483b..47c821f 100644
--- a/test/pdfs/.gitignore
+++ b/test/pdfs/.gitignore
@@ -23,6 +23,7 @@
!issue7020.pdf
!issue7101.pdf
!issue7115.pdf
+!issue7200.pdf
!filled-background.pdf
!ArabicCIDTrueType.pdf
!ThuluthFeatures.pdf
diff --git a/test/pdfs/issue7200.pdf b/test/pdfs/issue7200.pdf
new file mode 100644
index 0000000..2fb4b94
Binary files /dev/null and b/test/pdfs/issue7200.pdf differ
diff --git a/test/test_manifest.json b/test/test_manifest.json
index 609391b..e3c827c 100644
--- a/test/test_manifest.json
+++ b/test/test_manifest.json
@@ -1270,6 +1270,13 @@
"rounds": 1,
"type": "eq"
},
+ { "id": "issue7200",
+ "file": "pdfs/issue7200.pdf",
+ "md5": "ddae17424ea23930eecf8b612a66ed0f",
+ "link": false,
+ "rounds": 1,
+ "type": "eq"
+ },
{ "id": "pr4606",
"file": "pdfs/pr4606.pdf",
"md5": "6574fde2314648600056bd0e229df98c",
--
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