diff options
author | Szymon Kłos <szymon.klos@collabora.com> | 2021-10-25 12:04:30 +0200 |
---|---|---|
committer | Szymon Kłos <szymon.klos@collabora.com> | 2021-10-25 14:04:56 +0200 |
commit | 97b15bcc2d15dd754afbfbf8709fa62a9866160e (patch) | |
tree | f893e0e8a29969c8a1b8d036d83f9004e92eafc4 /xmlsecurity | |
parent | d267e5a0b1a05c595d7bd90987aceae5c98d90d5 (diff) |
tdf#145312 xmlsecurity: prevent from crash when cannot receive pdfium annotation
Change-Id: I6adc2cb0a07eb08a50c610958983493f4f8031ee
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124021
Tested-by: Szymon Kłos <szymon.klos@collabora.com>
Reviewed-by: Szymon Kłos <szymon.klos@collabora.com>
Diffstat (limited to 'xmlsecurity')
-rw-r--r-- | xmlsecurity/source/helper/pdfsignaturehelper.cxx | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/xmlsecurity/source/helper/pdfsignaturehelper.cxx b/xmlsecurity/source/helper/pdfsignaturehelper.cxx index 31740779de1c..95fca26f5945 100644 --- a/xmlsecurity/source/helper/pdfsignaturehelper.cxx +++ b/xmlsecurity/source/helper/pdfsignaturehelper.cxx @@ -275,6 +275,11 @@ void AnalyizeSignatureStream(SvMemoryStream& rStream, std::vector<PageChecksum>& for (int i = 0; i < pPdfPage->getAnnotationCount(); ++i) { std::unique_ptr<vcl::pdf::PDFiumAnnotation> pPdfAnnotation = pPdfPage->getAnnotation(i); + if (!pPdfAnnotation) + { + SAL_WARN("xmlsecurity.helper", "Cannot get PDFiumAnnotation"); + continue; + } vcl::pdf::PDFAnnotationSubType eType = pPdfAnnotation->getSubType(); switch (eType) { |