Skip to content

Commit

Permalink
stamping: Fix OCG reuse
Browse files Browse the repository at this point in the history
  • Loading branch information
hhrutter committed Jul 29, 2021
1 parent c3eb4c0 commit 16f43aa
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions pkg/pdfcpu/stamp.go
Original file line number Diff line number Diff line change
Expand Up @@ -1247,12 +1247,13 @@ func (ctx *Context) prepareOCPropertiesInRoot(onTop bool) (*IndirectRef, error)
if err != nil {
return nil, errCorruptOCGs
}

ir, ok := a[0].(IndirectRef)
if !ok {
return nil, errCorruptOCGs
if len(a) > 0 {
ir, ok := a[0].(IndirectRef)
if !ok {
return nil, errCorruptOCGs
}
return &ir, nil
}
return &ir, nil
}
}

Expand Down

0 comments on commit 16f43aa

Please sign in to comment.