[Pkg-javascript-commits] [pdf.js] 146/246: Fixes a regression from PR 4982
David Prévot
taffit at moszumanska.debian.org
Sun Sep 7 15:36:35 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 66c56ac5460c16384bc802f91f9e1e40cf5e2e0b
Author: Jonas Jenwald <jonas.jenwald at gmail.com>
Date: Fri Aug 8 12:50:54 2014 +0200
Fixes a regression from PR 4982
After PR 4982, the rendering of the first two pages of http://www.openmagazin.cz/pdf/2011/openMagazin-2011-04.pdf (from issue 215) no longer completes.
The issue is that we cannot have `args === null` in `PartialEvaluator_buildPath`, but *must* use an empty array instead.
In this patch I've also moved the `argsLength` variable definition in `EvaluatorPreprocessor_read`, to make sure that it's always defined.
---
src/core/evaluator.js | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/core/evaluator.js b/src/core/evaluator.js
index df1539d..5009712 100644
--- a/src/core/evaluator.js
+++ b/src/core/evaluator.js
@@ -578,6 +578,9 @@ var PartialEvaluator = (function PartialEvaluatorClosure() {
buildPath: function PartialEvaluator_buildPath(operatorList, fn, args) {
var lastIndex = operatorList.length - 1;
+ if (!args) {
+ args = [];
+ }
if (lastIndex < 0 ||
operatorList.fnArray[lastIndex] !== OPS.constructPath) {
operatorList.addOp(OPS.constructPath, [[fn], args]);
@@ -2123,10 +2126,10 @@ var EvaluatorPreprocessor = (function EvaluatorPreprocessorClosure() {
var fn = opSpec.id;
var numArgs = opSpec.numArgs;
+ var argsLength = args !== null ? args.length : 0;
if (!opSpec.variableArgs) {
// Postscript commands can be nested, e.g. /F2 /GS2 gs 5.711 Tf
- var argsLength = args !== null ? args.length : 0;
if (argsLength !== numArgs) {
var nonProcessedArgs = this.nonProcessedArgs;
while (argsLength > numArgs) {
--
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