Skip to content

Commit

Permalink
fix: font validation
Browse files Browse the repository at this point in the history
This patch removes the dictionary validation for type 3 font objects for
their additional resources. This change fixes stack overflow issues with
some documents.
  • Loading branch information
christiannicola committed Dec 4, 2024
1 parent ff51203 commit 97307a5
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions pkg/pdfcpu/validate/font.go
Original file line number Diff line number Diff line change
Expand Up @@ -953,16 +953,10 @@ func validateType3FontDict(xRefTable *model.XRefTable, d types.Dict) error {
}

// Resources, optional, dict, since V1.2
d1, err := validateDictEntry(xRefTable, d, dictName, "Resources", OPTIONAL, model.V12, nil)
_, err = validateDictEntry(xRefTable, d, dictName, "Resources", OPTIONAL, model.V12, nil)
if err != nil {
return err
}
if d1 != nil {
_, err := validateResourceDict(xRefTable, d1)
if err != nil {
return err
}
}

// ToUnicode, optional, stream
_, err = validateStreamDictEntry(xRefTable, d, dictName, "ToUnicode", OPTIONAL, model.V12, nil)
Expand Down

0 comments on commit 97307a5

Please sign in to comment.