diff --git a/src/core/cff_parser.js b/src/core/cff_parser.js index a6c7bae35..5ae67c6b4 100644 --- a/src/core/cff_parser.js +++ b/src/core/cff_parser.js @@ -626,6 +626,14 @@ const CFFParser = (function CFFParserClosure() { ", expected: " + validationCommand.min ); + + if (stackSize === 0) { + // Just "fix" the outline in replacing command by a endchar: + // it could lead to wrong rendering of some glyphs or not. + // For example, the pdf in #6132 is well-rendered. + data[j - 1] = 14; + return true; + } return false; } } diff --git a/test/pdfs/.gitignore b/test/pdfs/.gitignore index 1abd53fd2..124879e89 100644 --- a/test/pdfs/.gitignore +++ b/test/pdfs/.gitignore @@ -129,6 +129,7 @@ !bug1513120_reduced.pdf !bug1538111.pdf !bug1552113.pdf +!issue6132.pdf !issue9949.pdf !bug1308536.pdf !bug1337429.pdf diff --git a/test/pdfs/issue6132.pdf b/test/pdfs/issue6132.pdf new file mode 100644 index 000000000..da3a9b59e Binary files /dev/null and b/test/pdfs/issue6132.pdf differ diff --git a/test/test_manifest.json b/test/test_manifest.json index 27381b5d7..9209a24d6 100644 --- a/test/test_manifest.json +++ b/test/test_manifest.json @@ -2616,6 +2616,12 @@ "rounds": 1, "type": "eq" }, + { "id": "issue6132", + "file": "pdfs/issue6132.pdf", + "md5": "bd1e6252ca642acf2cd05db1748a073c", + "rounds": 1, + "type": "eq" + }, { "id": "issue4875", "file": "pdfs/issue4875.pdf", "md5": "9a558e18029a42c0ef4e9a8755e24733",