1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-20 07:08:08 +02:00
pdf.js/src
Jonas Jenwald 87142a635e Ensure that Font.charToGlyph won't fail because String.fromCodePoint is given an invalid code point (issue 11768)
*Please note:* This patch on its own is *not* sufficient to address the underlying problem in the referenced issue, hence why no test-case is included since the *actual* bug still needs to be fixed.

As can be seen in the specification, https://tc39.es/ecma262/#sec-string.fromcodepoint, `String.fromCodePoint` will throw a RangeError for invalid code points.

In the event that a CMap, in a composite font, contains invalid data and/or we fail to parse it correctly, it's thus possible that the glyph mapping that we build end up with entires that cause `String.fromCodePoint` to throw and thus `Font.charToGlyph` to break.
If that happens, as is the case in issue 11768, significant portions of a page/document may fail to render which seems very unfortunate.

While this patch doesn't fix the underlying problem, it's hopefully deemed useful not only for the referenced issue but also to prevent similar bugs in the future.
2020-04-03 09:49:50 +02:00
..
core Ensure that Font.charToGlyph won't fail because String.fromCodePoint is given an invalid code point (issue 11768) 2020-04-03 09:49:50 +02:00
display Whitelist closure related cases to address the remaining no-shadow linting errors 2020-03-25 11:57:12 +01:00
images Vectorize the logo. 2012-10-29 14:08:52 -04:00
shared Fail early, in modern GENERIC builds, if certain required browser functionality is missing (issue 11762) 2020-04-01 19:42:48 +02:00
doc_helper.js [api-major] Completely remove the global PDFJS object 2018-03-01 18:13:27 +01:00
interfaces.js Enable auto-formatting of the entire code-base using Prettier (issue 11444) 2019-12-26 12:34:24 +01:00
license_header.js Update the year in the license_header files 2020-01-05 12:14:03 +01:00
license_header_libre.js Update the year in the license_header files 2020-01-05 12:14:03 +01:00
pdf.image_decoders.js Ensure that all import and require statements, in the entire code-base, have a .js file extension 2020-01-04 13:01:43 +01:00
pdf.js Enable the ESLint prefer-const rule globally (PR 11450 follow-up) 2020-01-25 00:20:22 +01:00
pdf.worker.entry.js Update the year in the license_header files 2020-01-05 12:14:03 +01:00
pdf.worker.js Enable auto-formatting of the entire code-base using Prettier (issue 11444) 2019-12-26 12:34:24 +01:00
worker_loader.js Ensure that all import and require statements, in the entire code-base, have a .js file extension 2020-01-04 13:01:43 +01:00