Ignore malformed dictionary entries.

This commit is contained in:
Brendan Dahl 2013-04-30 15:29:25 -07:00
parent 8d6aac1fe3
commit cec200a664
3 changed files with 16 additions and 3 deletions

View File

@ -17,7 +17,7 @@
/* globals Ascii85Stream, AsciiHexStream, CCITTFaxStream, Cmd, Dict, error, /* globals Ascii85Stream, AsciiHexStream, CCITTFaxStream, Cmd, Dict, error,
FlateStream, isArray, isCmd, isDict, isInt, isName, isNum, isRef, FlateStream, isArray, isCmd, isDict, isInt, isName, isNum, isRef,
isString, Jbig2Stream, JpegStream, JpxStream, LZWStream, Name, isString, Jbig2Stream, JpegStream, JpxStream, LZWStream, Name,
NullStream, PredictorStream, Ref, RunLengthStream, warn */ NullStream, PredictorStream, Ref, RunLengthStream, warn, info */
'use strict'; 'use strict';
@ -85,8 +85,11 @@ var Parser = (function ParserClosure() {
this.shift(); this.shift();
var dict = new Dict(this.xref); var dict = new Dict(this.xref);
while (!isCmd(this.buf1, '>>') && !isEOF(this.buf1)) { while (!isCmd(this.buf1, '>>') && !isEOF(this.buf1)) {
if (!isName(this.buf1)) if (!isName(this.buf1)) {
error('Dictionary key must be a name object'); info('Malformed dictionary, key must be a name object');
this.shift();
continue;
}
var key = this.buf1.name; var key = this.buf1.name;
this.shift(); this.shift();

View File

@ -0,0 +1,2 @@
http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n1984.pdf

View File

@ -1051,6 +1051,14 @@
"type": "eq", "type": "eq",
"about": "Has a 4 bit per component image with mask and decode." "about": "Has a 4 bit per component image with mask and decode."
}, },
{ "id": "bug808084",
"file": "pdfs/bug808084.pdf",
"md5": "b1c400de699af29ea3f1983bb26870ab",
"link": true,
"rounds": 1,
"lastPage": 1,
"type": "load"
},
{ "id": "issue3064", { "id": "issue3064",
"file": "pdfs/issue3064.pdf", "file": "pdfs/issue3064.pdf",
"md5": "0307415b7d69b13acaf8bd4285d9544b", "md5": "0307415b7d69b13acaf8bd4285d9544b",