Merge pull request #4907 from CodingFabian/fix-4906
add object id to streams to prevent infinite loops.
This commit is contained in:
commit
fc85cfdb83
@ -100,6 +100,13 @@ var PartialEvaluator = (function PartialEvaluatorClosure() {
|
||||
if (!isStream(xObject)) {
|
||||
continue;
|
||||
}
|
||||
if (xObject.dict.objId) {
|
||||
if (processed[xObject.dict.objId]) {
|
||||
// stream has objId and is processed already
|
||||
continue;
|
||||
}
|
||||
processed[xObject.dict.objId] = true;
|
||||
}
|
||||
var xResources = xObject.dict.get('Resources');
|
||||
// Checking objId to detect an infinite loop.
|
||||
if (isDict(xResources) &&
|
||||
|
@ -1175,9 +1175,10 @@ var XRef = (function XRefClosure() {
|
||||
} else {
|
||||
xrefEntry = this.fetchCompressed(xrefEntry, suppressEncryption);
|
||||
}
|
||||
|
||||
if (isDict(xrefEntry)) {
|
||||
if (isDict(xrefEntry)){
|
||||
xrefEntry.objId = 'R' + ref.num + '.' + ref.gen;
|
||||
} else if (isStream(xrefEntry)) {
|
||||
xrefEntry.dict.objId = 'R' + ref.num + '.' + ref.gen;
|
||||
}
|
||||
return xrefEntry;
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user