summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.com>2022-08-01 09:31:48 +0200
committerMiklos Vajna <vmiklos@collabora.com>2022-08-01 10:29:37 +0200
commite7e6cd1f5e9723c2642075fed46e868342be0bf0 (patch)
tree8817db9559c5fe25ab94ed87c1735025fdc14c11 /vcl
parent5525e4d103a1d3b1ebfce3e3f2a2ec79e2f0b845 (diff)
vcl: fix crash in vcl::ImportPDFUnloaded()
Crashreport signature: SIG Fatal signal received: SIGSEGV code: 1 for address: 0x0 program/libmergedlo.so vcl::ImportPDFUnloaded(rtl::OUString const&, std::vector<vcl::PDFGraphicResult, std::allocator<vcl::PDFGraphicResult> >&) vcl/source/filter/ipdf/pdfread.cxx:256 program/../program/libsdlo.so SdPdfFilter::Import() sd/source/filter/pdf/sdpdffilter.cxx:55 program/../program/libsdlo.so sd::DrawDocShell::ConvertFrom(SfxMedium&) sd/source/ui/docshell/docshel4.cxx:500 (discriminator 1) program/libmergedlo.so SfxObjectShell::DoLoad(SfxMedium*) sfx2/source/doc/objstor.cxx:768 Change-Id: I2fc635de696643af6a80a29aa5af4fa128f8776c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137669 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Diffstat (limited to 'vcl')
-rw-r--r--vcl/source/filter/ipdf/pdfread.cxx5
1 files changed, 5 insertions, 0 deletions
diff --git a/vcl/source/filter/ipdf/pdfread.cxx b/vcl/source/filter/ipdf/pdfread.cxx
index 339ff5dac7fa..7a6209c9aa31 100644
--- a/vcl/source/filter/ipdf/pdfread.cxx
+++ b/vcl/source/filter/ipdf/pdfread.cxx
@@ -253,6 +253,11 @@ std::vector<PDFGraphicAnnotation>
findAnnotations(const std::unique_ptr<vcl::pdf::PDFiumPage>& pPage, basegfx::B2DSize aPageSize)
{
std::vector<PDFGraphicAnnotation> aPDFGraphicAnnotations;
+ if (!pPage)
+ {
+ return aPDFGraphicAnnotations;
+ }
+
for (int nAnnotation = 0; nAnnotation < pPage->getAnnotationCount(); nAnnotation++)
{
auto pAnnotation = pPage->getAnnotation(nAnnotation);