From 992472fd38cea110df7564910f9fe90c1a0b79b8 Mon Sep 17 00:00:00 2001 From: Jonas Jenwald Date: Fri, 29 Jan 2016 18:22:25 +0100 Subject: [PATCH] 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 5366aebb1..17816c69f 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); }