[Pkg-javascript-commits] [pdf.js] 177/414: Ensure that we don't modify the `Dict` data when the `Differences` array of a font contains indirect objects

David Prévot taffit at moszumanska.debian.org
Tue Jun 28 17:12:19 UTC 2016


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository pdf.js.

commit 992472fd38cea110df7564910f9fe90c1a0b79b8
Author: Jonas Jenwald <jonas.jenwald at gmail.com>
Date:   Fri Jan 29 18:22:25 2016 +0100

    Ensure that we don't modify the `Dict` data when the `Differences` array of a font contains indirect objects
    
    This patch fixes an issue that I inadvertently introduced in PR 5815, where we accidentally modify the `Differences` array in the encoding dictionary for indirect objects.
    
    Instead of this change, we could also have used the now existing `Dict_getArray`. However in this case I don't think that would have been a good idea, since it would mean iterating through the array *twice*.
---
 src/core/evaluator.js | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/src/core/evaluator.js b/src/core/evaluator.js
index 5366aeb..17816c6 100644
--- a/src/core/evaluator.js
+++ b/src/core/evaluator.js
@@ -1566,14 +1566,11 @@ var PartialEvaluator = (function PartialEvaluatorClosure() {
             var diffEncoding = encoding.get('Differences');
             var index = 0;
             for (var j = 0, jj = diffEncoding.length; j < jj; j++) {
-              var data = diffEncoding[j];
+              var data = xref.fetchIfRef(diffEncoding[j]);
               if (isNum(data)) {
                 index = data;
               } else if (isName(data)) {
                 differences[index++] = data.name;
-              } else if (isRef(data)) {
-                diffEncoding[j--] = xref.fetch(data);
-                continue;
               } else {
                 error('Invalid entry in \'Differences\' array: ' + data);
               }

-- 
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