mirror of
https://github.com/unidoc/unipdf.git
synced 2025-04-27 13:48:51 +08:00
Skip invalid Metadata stream in form field Kids array
This commit is contained in:
parent
a60d343750
commit
05eee50b4c
@ -681,6 +681,15 @@ func (r *PdfReader) newPdfFieldFromIndirectObject(container *core.PdfIndirectObj
|
|||||||
for _, obj := range kids.Elements() {
|
for _, obj := range kids.Elements() {
|
||||||
container, isIndirect := core.GetIndirect(obj)
|
container, isIndirect := core.GetIndirect(obj)
|
||||||
if !isIndirect {
|
if !isIndirect {
|
||||||
|
stream, ok := core.GetStream(obj)
|
||||||
|
if ok && stream.PdfObjectDictionary != nil {
|
||||||
|
nodeType, ok := core.GetNameVal(stream.Get("Type"))
|
||||||
|
if ok && nodeType == "Metadata" {
|
||||||
|
common.Log.Debug("ERROR: form field Kids array contains invalid Metadata stream. Skipping.")
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return nil, errors.New("not an indirect object (form field)")
|
return nil, errors.New("not an indirect object (form field)")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user