summaryrefslogtreecommitdiff
path: root/vcl/source
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.com>2022-08-01 09:31:48 +0200
committerXisco Fauli <xiscofauli@libreoffice.org>2022-08-08 23:16:29 +0200
commit8e5886ad0993a360f24a83de9bc2645271e92185 (patch)
tree566049588b747a45201ce2014526de7cf2198923 /vcl/source
parent8a3548eb859553a930a6120105cd30b3cc0ffeb3 (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/+/137673 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins (cherry picked from commit 60f9ca81e84f1bede4928c6f680325692cc8bc49) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137965 Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org> (cherry picked from commit f37998fdc3044ce8d477c2cfb0b9219d5f8ba75d) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137969
Diffstat (limited to 'vcl/source')
-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 a69d10c7cafc..90d195acf752 100644
--- a/vcl/source/filter/ipdf/pdfread.cxx
+++ b/vcl/source/filter/ipdf/pdfread.cxx
@@ -252,6 +252,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);