Skip to content

Commit

Permalink
Merge pull request mozilla#8913 from Snuffleupagus/issue-8895
Browse files Browse the repository at this point in the history
For /Filter entries containing `Name`s, ignore the /DecodeParms entry if it contains an Array (issue 8895)
  • Loading branch information
timvandermeij authored Sep 16, 2017
2 parents 04674a5 + 5cc8048 commit 9ca8a34
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/core/parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -528,7 +528,8 @@ var Parser = (function ParserClosure() {
var params = dict.get('DecodeParms', 'DP');
if (isName(filter)) {
if (Array.isArray(params)) {
params = this.xref.fetchIfRef(params[0]);
warn('/DecodeParms should not contain an Array, ' +
'when /Filter contains a Name.');
}
return this.makeFilter(stream, filter.name, length, params);
}
Expand Down
5 changes: 3 additions & 2 deletions src/core/stream.js
Original file line number Diff line number Diff line change
Expand Up @@ -1748,8 +1748,9 @@ var CCITTFaxStream = (function CCITTFaxStreamClosure() {
this.str = str;
this.dict = str.dict;

params = params || Dict.empty;

if (!isDict(params)) {
params = Dict.empty;
}
this.encoding = params.get('K') || 0;
this.eoline = params.get('EndOfLine') || false;
this.byteAlign = params.get('EncodedByteAlign') || false;
Expand Down
1 change: 1 addition & 0 deletions test/pdfs/issue8895.pdf.link
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
https://issues.apache.org/jira/secure/attachment/12887373/PDFJS-8895-p1.pdf
8 changes: 8 additions & 0 deletions test/test_manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -698,6 +698,14 @@
"link": false,
"type": "eq"
},
{ "id": "issue8895",
"file": "pdfs/issue8895.pdf",
"md5": "098658008fc2bf7d433fd0d6d468a9e1",
"rounds": 1,
"link": true,
"lastPage": 1,
"type": "eq"
},
{ "id": "issue5509",
"file": "pdfs/issue5509.pdf",
"md5": "1975ef8db7355b1d691bc79d0749574b",
Expand Down

0 comments on commit 9ca8a34

Please sign in to comment.