Check errors

This commit is contained in:
Paul van Brouwershaven
2022-06-30 18:04:25 +02:00
parent 0e77069efa
commit 44ac3c7806
8 changed files with 87 additions and 54 deletions

View File

@@ -11,7 +11,9 @@ func (context *SignContext) writeTrailer() error {
trailer_length := context.PDFReader.XrefInformation.IncludingTrailerEndPos - context.PDFReader.XrefInformation.EndPos
// Read the trailer so we can replace the size.
context.InputFile.Seek(context.PDFReader.XrefInformation.EndPos+1, 0)
if _, err := context.InputFile.Seek(context.PDFReader.XrefInformation.EndPos+1, 0); err != nil {
return err
}
trailer_buf := make([]byte, trailer_length)
if _, err := context.InputFile.Read(trailer_buf); err != nil {
return err