diff --git a/xmlsecurity/source/pdfio/pdfdocument.cxx b/xmlsecurity/source/pdfio/pdfdocument.cxx index a0e00ef8f3f5..1ca73618cff5 100644 --- a/xmlsecurity/source/pdfio/pdfdocument.cxx +++ b/xmlsecurity/source/pdfio/pdfdocument.cxx @@ -909,6 +909,13 @@ bool PDFDocument::Read(SvStream& rStream) SAL_WARN("xmlsecurity.pdfio", "PDFDocument::Read: failed to tokenizer trailer after xref"); return false; } + + if (!m_pTrailer) + { + SAL_WARN("xmlsecurity.pdfio", "PDFDocument::Read: found no trailer"); + return false; + } + auto pPrev = dynamic_cast(m_pTrailer->Lookup("Prev")); if (pPrev) nStartXRef = pPrev->GetValue();