[Pkg-javascript-commits] [pdf.js] 33/207: add object id to streams to prevent infinite loops.
David Prévot
taffit at moszumanska.debian.org
Mon Jul 28 15:36:26 UTC 2014
This is an automated email from the git hooks/post-receive script.
taffit pushed a commit to branch master
in repository pdf.js.
commit 532d7246ea1b67f5b9752f6b3a2c3dbf2c09c9c6
Author: Fabian Lange <lange.fabian at gmail.com>
Date: Tue Jun 10 11:29:25 2014 +0200
add object id to streams to prevent infinite loops.
fixes http://bugzil.la/1020858
---
src/core/evaluator.js | 7 +++++++
src/core/obj.js | 5 +++--
2 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/src/core/evaluator.js b/src/core/evaluator.js
index ccfa138..37880c0 100644
--- a/src/core/evaluator.js
+++ b/src/core/evaluator.js
@@ -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) &&
diff --git a/src/core/obj.js b/src/core/obj.js
index 879b7f0..858e006 100644
--- a/src/core/obj.js
+++ b/src/core/obj.js
@@ -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;
},
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/pdf.js.git
More information about the Pkg-javascript-commits
mailing list