diff --git a/src/core/cff_parser.js b/src/core/cff_parser.js index 540972e9e4f6e..d4b67901b79c6 100644 --- a/src/core/cff_parser.js +++ b/src/core/cff_parser.js @@ -1407,6 +1407,12 @@ class CFFCompiler { } } + const xuid = cff.topDict.getByName("XUID"); + if (xuid && xuid.length > 16) { + // Length of XUID array must not be greater than 16 (issue #12399). + cff.topDict.removeByName("XUID"); + } + cff.topDict.setByName("charset", 0); var compiled = this.compileTopDicts( [cff.topDict], diff --git a/test/pdfs/.gitignore b/test/pdfs/.gitignore index 33b9df646d6c5..cadb2e9f3c3fe 100644 --- a/test/pdfs/.gitignore +++ b/test/pdfs/.gitignore @@ -169,6 +169,7 @@ !issue5202.pdf !images_1bit_grayscale.pdf !issue5280.pdf +!issue12399_reduced.pdf !issue5677.pdf !issue5954.pdf !issue6612.pdf diff --git a/test/pdfs/issue12399_reduced.pdf b/test/pdfs/issue12399_reduced.pdf new file mode 100644 index 0000000000000..10241c031e4f2 Binary files /dev/null and b/test/pdfs/issue12399_reduced.pdf differ diff --git a/test/test_manifest.json b/test/test_manifest.json index f2de8f17273b1..9a566ca30347b 100644 --- a/test/test_manifest.json +++ b/test/test_manifest.json @@ -1914,6 +1914,12 @@ "type": "eq", "about": "Please note that this file currently renders incorrectly." }, + { "id": "issue12399", + "file": "pdfs/issue12399_reduced.pdf", + "md5": "01bdd258be93e10f8399708eecedbfd6", + "rounds": 1, + "type": "eq" + }, { "id": "issue5808-text", "file": "pdfs/issue5808.pdf", "md5": "e0584dd540d7859d6c191aa53379692e",