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:
@@ -909,6 +909,13 @@ bool PDFDocument::Read(SvStream& rStream)
|
|||||||
SAL_WARN("xmlsecurity.pdfio", "PDFDocument::Read: failed to tokenizer trailer after xref");
|
SAL_WARN("xmlsecurity.pdfio", "PDFDocument::Read: failed to tokenizer trailer after xref");
|
||||||
return false;
|
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"));
|
auto pPrev = dynamic_cast<PDFNumberElement*>(m_pTrailer->Lookup("Prev"));
|
||||||
if (pPrev)
|
if (pPrev)
|
||||||
nStartXRef = pPrev->GetValue();
|
nStartXRef = pPrev->GetValue();
|
||||||
|
Reference in New Issue
Block a user