1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-22 16:18:08 +02:00

Merge pull request #11698 from Snuffleupagus/issue-11697

Don't accidentally accept invalid glyphNames which *appear* to follow the Cdd{d}/cdd{d} format in `PartialEvaluator._buildSimpleFontToUnicode` (issue 11697)
This commit is contained in:
Tim van der Meij 2020-03-15 13:36:09 +01:00 committed by GitHub
commit 1bc5cef2b5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 10 additions and 2 deletions

View file

@ -2574,7 +2574,7 @@ var PartialEvaluator = (function PartialEvaluatorClosure() {
code = unicode;
}
}
if (code) {
if (code > 0 && Number.isInteger(code)) {
// If `baseEncodingName` is one the predefined encodings, and `code`
// equals `charcode`, using the glyph defined in the baseEncoding
// seems to yield a better `toUnicode` mapping (fixes issue 5070).