diff --git a/vcl/source/filter/ipdf/pdfdocument.cxx b/vcl/source/filter/ipdf/pdfdocument.cxx index bce5265de69e..bbb9b84ea5bc 100644 --- a/vcl/source/filter/ipdf/pdfdocument.cxx +++ b/vcl/source/filter/ipdf/pdfdocument.cxx @@ -574,9 +574,10 @@ bool PDFDocument::WriteCatalogObject(sal_Int32 nAnnotId, PDFReferenceElement*& p if (!pAcroFormDictionary) { // No AcroForm key, assume no signatures. - m_aEditBuffer.WriteBytes(static_cast(m_aEditBuffer.GetData()) - + pCatalog->GetDictionaryOffset(), - pCatalog->GetDictionaryLength()); + auto const p = static_cast(m_aEditBuffer.GetData()) + + pCatalog->GetDictionaryOffset(); + std::vector copy(p, p + pCatalog->GetDictionaryLength()); + m_aEditBuffer.WriteBytes(copy.data(), copy.size()); m_aEditBuffer.WriteOString("/AcroForm<>\n");