diff --git a/src/core/fonts.js b/src/core/fonts.js index dad5259fb..1f2f46de5 100644 --- a/src/core/fonts.js +++ b/src/core/fonts.js @@ -3175,6 +3175,10 @@ var Font = (function FontClosure() { coordinatesLength += repeat * xyLength; } } + // glyph without coordinates will be rejected + if (coordinatesLength === 0) { + return 0; + } var glyphDataLength = j + coordinatesLength; if (glyphDataLength > glyf.length) { // not enough data for coordinates diff --git a/test/pdfs/.gitignore b/test/pdfs/.gitignore index f4b3d7ec9..f88789fda 100644 --- a/test/pdfs/.gitignore +++ b/test/pdfs/.gitignore @@ -21,6 +21,7 @@ !devicen.pdf !cmykjpeg.pdf !issue840.pdf +!issue3438.pdf !issue2074.pdf !scan-bad.pdf !bug860632.pdf diff --git a/test/pdfs/issue3438.pdf b/test/pdfs/issue3438.pdf new file mode 100644 index 000000000..9c426c22d Binary files /dev/null and b/test/pdfs/issue3438.pdf differ diff --git a/test/test_manifest.json b/test/test_manifest.json index 414ef0d16..4ef1ca4ac 100644 --- a/test/test_manifest.json +++ b/test/test_manifest.json @@ -1304,6 +1304,12 @@ "rounds": 1, "type": "eq" }, + { "id": "issue3438", + "file": "pdfs/issue3438.pdf", + "md5": "5aa3340b0920b65a377f697587668f89", + "rounds": 1, + "type": "eq" + }, { "id": "bug886717", "file": "pdfs/bug886717.pdf", "md5": "8ba614192797a1324765610231a1bc9d",