Merge pull request #4971 from yurydelendik/rm-suppressEncryption
Removes error catch from fetchUncompressed()
This commit is contained in:
commit
c0a6b0f308
@ -1216,15 +1216,7 @@ var XRef = (function XRefClosure() {
|
||||
error('bad XRef entry');
|
||||
}
|
||||
if (this.encrypt && !suppressEncryption) {
|
||||
try {
|
||||
xrefEntry = parser.getObj(this.encrypt.createCipherTransform(num,
|
||||
gen));
|
||||
} catch (ex) {
|
||||
// Almost all streams must be encrypted, but sometimes
|
||||
// they are not, probably due to some broken generators.
|
||||
// Retrying without encryption...
|
||||
return this.fetch(ref, true);
|
||||
}
|
||||
xrefEntry = parser.getObj(this.encrypt.createCipherTransform(num, gen));
|
||||
} else {
|
||||
xrefEntry = parser.getObj();
|
||||
}
|
||||
|
@ -18,7 +18,7 @@
|
||||
FlateStream, isArray, isCmd, isDict, isInt, isName, isNum, isRef,
|
||||
isString, Jbig2Stream, JpegStream, JpxStream, LZWStream, Name,
|
||||
NullStream, PredictorStream, Ref, RunLengthStream, warn, info,
|
||||
StreamType */
|
||||
StreamType, MissingDataException */
|
||||
|
||||
'use strict';
|
||||
|
||||
@ -344,6 +344,7 @@ var Parser = (function ParserClosure() {
|
||||
if (stream.dict.get('Length') === 0) {
|
||||
return new NullStream(stream);
|
||||
}
|
||||
try {
|
||||
var xrefStreamStats = this.xref.stats.streamTypes;
|
||||
if (name == 'FlateDecode' || name == 'Fl') {
|
||||
xrefStreamStats[StreamType.FLATE] = true;
|
||||
@ -396,6 +397,13 @@ var Parser = (function ParserClosure() {
|
||||
}
|
||||
warn('filter "' + name + '" not supported yet');
|
||||
return stream;
|
||||
} catch (ex) {
|
||||
if (ex instanceof MissingDataException) {
|
||||
throw ex;
|
||||
}
|
||||
warn('Invalid stream: \"' + ex + '\"');
|
||||
return new NullStream(stream);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user