1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-23 08:38:06 +02:00

Ignore optional content with missing /Type-entries

In the rare situation that an optional content dictionary lacks a /Type-entry we currently throw, which may prevent e.g. Form XObjects from rendering completely.

Fixes https://bugs.ghostscript.com/show_bug.cgi?id=707147
This commit is contained in:
Jonas Jenwald 2023-09-19 12:26:55 +02:00
parent daae6589b6
commit 0ac8f33e13
3 changed files with 10 additions and 1 deletions

View file

@ -1581,7 +1581,7 @@ class PartialEvaluator {
throw new FormatError("Optional content properties malformed.");
}
const optionalContentType = optionalContent.get("Type").name;
const optionalContentType = optionalContent.get("Type")?.name;
if (optionalContentType === "OCG") {
return {
type: optionalContentType,