fix infinite loop

This commit is contained in:
Pete Matsyburka committed 2026-08-10 06:01:20 +03:00
1 parent b9018fa442
commit 8e254b7d3c
2 files changed
+31 -1

No files matched your search

+3 -1
View File
@@ -251,7 +251,9 @@ module Templates
fields_index[annot.hash] ||= HexaPDF::Type::AcroForm::Field.wrap(pdf, annot)
elsif annot.key?(:Parent)
field = annot[:Parent]
field = field[:Parent] while field[:Parent]
seen = Set.new.compare_by_identity
field = field[:Parent] while field[:Parent] && seen.add?(field.value)
annots_index[field.hash] ||= page
fields_index[field.hash] ||= HexaPDF::Type::AcroForm::Field.wrap(pdf, field)