Ignoring glyphs without points

This commit is contained in:
Yury Delendik 2013-11-02 17:07:13 -05:00
parent 1ce8afc23c
commit 93076ced03
4 changed files with 11 additions and 0 deletions

View File

@ -3164,6 +3164,10 @@ var Font = (function FontClosure() {
coordinatesLength += repeat * xyLength; coordinatesLength += repeat * xyLength;
} }
} }
// glyph without coordinates will be rejected
if (coordinatesLength === 0) {
return 0;
}
var glyphDataLength = j + coordinatesLength; var glyphDataLength = j + coordinatesLength;
if (glyphDataLength > glyf.length) { if (glyphDataLength > glyf.length) {
// not enough data for coordinates // not enough data for coordinates

View File

@ -21,6 +21,7 @@
!devicen.pdf !devicen.pdf
!cmykjpeg.pdf !cmykjpeg.pdf
!issue840.pdf !issue840.pdf
!issue3438.pdf
!issue2074.pdf !issue2074.pdf
!scan-bad.pdf !scan-bad.pdf
!pdfjsbad1586.pdf !pdfjsbad1586.pdf

BIN
test/pdfs/issue3438.pdf Normal file

Binary file not shown.

View File

@ -1288,6 +1288,12 @@
"rounds": 1, "rounds": 1,
"type": "eq" "type": "eq"
}, },
{ "id": "issue3438",
"file": "pdfs/issue3438.pdf",
"md5": "5aa3340b0920b65a377f697587668f89",
"rounds": 1,
"type": "eq"
},
{ "id": "bug886717", { "id": "bug886717",
"file": "pdfs/bug886717.pdf", "file": "pdfs/bug886717.pdf",
"md5": "8ba614192797a1324765610231a1bc9d", "md5": "8ba614192797a1324765610231a1bc9d",