Merge pull request #6940 from Snuffleupagus/differences-fix-indirect-objects

Ensure that we don't modify the `Dict` data when the `Differences` array of a font contains indirect objects
This commit is contained in:
Tim van der Meij 2016-01-31 20:17:16 +01:00
commit a4b90243d0

View File

@ -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);
}