xmlsecurity PDF verify: handle missing trailer

Support for Cross-Reference Streams is still missing, but this avoids
a crash at least.

Change-Id: I8c5d16531f8603feeebe8feddb7c3bdfa61943cb
This commit is contained in:
Miklos Vajna 2016-10-27 17:34:35 +02:00
parent 4433d95b37
commit 4beac67a2b

View File

@ -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<PDFNumberElement*>(m_pTrailer->Lookup("Prev"));
if (pPrev)
nStartXRef = pPrev->GetValue();