[Pkg-javascript-commits] [pdf.js] 13/157: Ignore paint form XObject when the name is missing (issue 4558)
David Prévot
taffit at moszumanska.debian.org
Tue Aug 11 06:46:25 UTC 2015
This is an automated email from the git hooks/post-receive script.
taffit pushed a commit to branch master
in repository pdf.js.
commit 46a8485db45d3ca4520fc06e68519b21fe428681
Author: Jonas Jenwald <jonas.jenwald at gmail.com>
Date: Mon Jun 22 13:33:15 2015 +0200
Ignore paint form XObject when the name is missing (issue 4558)
Fixes 4558 (since the font issues already appear to be fixed).
---
src/core/evaluator.js | 4 ++++
test/unit/evaluator_spec.js | 11 +++++++++++
2 files changed, 15 insertions(+)
diff --git a/src/core/evaluator.js b/src/core/evaluator.js
index be26159..ed137f8 100644
--- a/src/core/evaluator.js
+++ b/src/core/evaluator.js
@@ -658,6 +658,10 @@ var PartialEvaluator = (function PartialEvaluatorClosure() {
}
// eagerly compile XForm objects
var name = args[0].name;
+ if (!name) {
+ warn('XObject must be referred to by name.');
+ continue;
+ }
if (imageCache[name] !== undefined) {
operatorList.addOp(imageCache[name].fn, imageCache[name].args);
args = null;
diff --git a/test/unit/evaluator_spec.js b/test/unit/evaluator_spec.js
index bc4ba12..412a835 100644
--- a/test/unit/evaluator_spec.js
+++ b/test/unit/evaluator_spec.js
@@ -227,5 +227,16 @@ describe('evaluator', function() {
expect(result.fnArray[3]).toEqual(OPS.restore);
});
});
+ it('should skip paint form XObject if name is missing', function() {
+ var evaluator = new PartialEvaluator(new PdfManagerMock(),
+ new XrefMock(), new HandlerMock(),
+ 'prefix');
+ var stream = new StringStream('/ Do');
+ runOperatorListCheck(evaluator, stream, new ResourcesMock(),
+ function (result) {
+ expect(result.argsArray).toEqual([]);
+ expect(result.fnArray).toEqual([]);
+ });
+ });
});
});
--
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