diff --git a/src/core/colorspace.js b/src/core/colorspace.js index b6db08698..bebe9521a 100644 --- a/src/core/colorspace.js +++ b/src/core/colorspace.js @@ -260,7 +260,7 @@ var ColorSpace = (function ColorSpaceClosure() { error('unrecognized colorspace ' + mode); } } else if (isArray(cs)) { - mode = cs[0].name; + mode = xref.fetchIfRef(cs[0]).name; this.mode = mode; var numComps, params; @@ -293,7 +293,7 @@ var ColorSpace = (function ColorSpaceClosure() { } break; case 'Pattern': - var basePatternCS = cs[1]; + var basePatternCS = xref.fetchIfRef(cs[1]) || null; if (basePatternCS) { basePatternCS = ColorSpace.parseToIR(basePatternCS, xref, res); } diff --git a/test/pdfs/.gitignore b/test/pdfs/.gitignore index 00553605e..f33c1a83c 100644 --- a/test/pdfs/.gitignore +++ b/test/pdfs/.gitignore @@ -134,3 +134,4 @@ !issue5909.pdf !issue6010_1.pdf !issue6010_2.pdf +!issue6081.pdf diff --git a/test/pdfs/issue6081.pdf b/test/pdfs/issue6081.pdf new file mode 100644 index 000000000..096d85dde Binary files /dev/null and b/test/pdfs/issue6081.pdf differ diff --git a/test/test_manifest.json b/test/test_manifest.json index 55e924245..a004897e0 100644 --- a/test/test_manifest.json +++ b/test/test_manifest.json @@ -1531,6 +1531,13 @@ "type": "eq", "about": "Pattern with current transform different than base transform." }, + { "id": "issue6081", + "file": "pdfs/issue6081.pdf", + "md5": "854326ce9178d10ff4a0ff2aedf67e45", + "rounds": 1, + "link": false, + "type": "eq" + }, { "id": "issue2462", "file": "pdfs/issue2462.pdf", "md5": "d4e3dddfdd35464c71cf0310bff29b42",