1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-22 16:18:08 +02:00

Prevent getOperatorList from failing to correctly parse OPS.paintXObject for TilingPatterns that are missing some /Resources entries (issue 6541)

Fixes 6541.
This commit is contained in:
Jonas Jenwald 2015-10-20 20:22:06 +02:00
parent 738daa0f79
commit 2e751199fb
4 changed files with 219 additions and 3 deletions

View file

@ -286,9 +286,13 @@ var PartialEvaluator = (function PartialEvaluatorClosure() {
operatorList) {
// Create an IR of the pattern code.
var tilingOpList = new OperatorList();
return this.getOperatorList(pattern,
(patternDict.get('Resources') || resources), tilingOpList).
then(function () {
// Merge the available resources, to prevent issues when the patternDict
// is missing some /Resources entries (fixes issue6541.pdf).
var resourcesArray = [patternDict.get('Resources'), resources];
var patternResources = Dict.merge(this.xref, resourcesArray);
return this.getOperatorList(pattern, patternResources, tilingOpList).then(
function () {
// Add the dependencies to the parent operator list so they are
// resolved before sub operator list is executed synchronously.
operatorList.addDependencies(tilingOpList.dependencies);