mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-10 02:05:37 +02:00
add object id to streams to prevent infinite loops.
fixes http://bugzil.la/1020858
This commit is contained in:
parent
806aa36aa8
commit
532d7246ea
2 changed files with 10 additions and 2 deletions
|
@ -100,6 +100,13 @@ var PartialEvaluator = (function PartialEvaluatorClosure() {
|
||||||
if (!isStream(xObject)) {
|
if (!isStream(xObject)) {
|
||||||
continue;
|
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');
|
var xResources = xObject.dict.get('Resources');
|
||||||
// Checking objId to detect an infinite loop.
|
// Checking objId to detect an infinite loop.
|
||||||
if (isDict(xResources) &&
|
if (isDict(xResources) &&
|
||||||
|
|
|
@ -1175,9 +1175,10 @@ var XRef = (function XRefClosure() {
|
||||||
} else {
|
} else {
|
||||||
xrefEntry = this.fetchCompressed(xrefEntry, suppressEncryption);
|
xrefEntry = this.fetchCompressed(xrefEntry, suppressEncryption);
|
||||||
}
|
}
|
||||||
|
if (isDict(xrefEntry)){
|
||||||
if (isDict(xrefEntry)) {
|
|
||||||
xrefEntry.objId = 'R' + ref.num + '.' + ref.gen;
|
xrefEntry.objId = 'R' + ref.num + '.' + ref.gen;
|
||||||
|
} else if (isStream(xrefEntry)) {
|
||||||
|
xrefEntry.dict.objId = 'R' + ref.num + '.' + ref.gen;
|
||||||
}
|
}
|
||||||
return xrefEntry;
|
return xrefEntry;
|
||||||
},
|
},
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue