1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-22 16:18:08 +02:00

Merge pull request #3183 from brendandahl/ignore-bad-dicts

Ignore malformed dictionary entries.
This commit is contained in:
Yury Delendik 2013-04-30 17:22:07 -07:00
commit 78ad4d4eaf
3 changed files with 16 additions and 3 deletions

View file

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