vcl/source/filter/ipdf/pdfread.cxx | 4 ++++ 1 file changed, 4 insertions(+)
New commits: commit c7c29aba6f9facdac1c9f2a7902a7aa46c2d0629 Author: Miklos Vajna <[email protected]> AuthorDate: Fri Nov 8 13:50:35 2024 +0100 Commit: Caolán McNamara <[email protected]> CommitDate: Fri Nov 8 15:14:24 2024 +0100 vcl: fix crash in findAnnotations() 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:335 > program/libsdlo.so > SdPdfFilter::Import() > sd/source/filter/pdf/sdpdffilter.cxx:55 > program/libsdlo.so > sd::DrawDocShell::ConvertFrom(SfxMedium&) > sd/source/ui/docshell/docshel4.cxx:502 (discriminator 2) > libmergedlo.so > SfxObjectShell::DoLoad(SfxMedium*) > sfx2/source/doc/objstor.cxx:786 I.e. in case we search for a marker image inside the annotation's object, then handle the image type without a bitmap the same as non-image types. Change-Id: I443b5f448ea4544183fb4ed0b457e85a45f51acc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176278 Reviewed-by: Caolán McNamara <[email protected]> Tested-by: Jenkins CollaboraOffice <[email protected]> diff --git a/vcl/source/filter/ipdf/pdfread.cxx b/vcl/source/filter/ipdf/pdfread.cxx index 20b4e036467f..148a46f5da11 100644 --- a/vcl/source/filter/ipdf/pdfread.cxx +++ b/vcl/source/filter/ipdf/pdfread.cxx @@ -332,6 +332,10 @@ findAnnotations(const std::unique_ptr<vcl::pdf::PDFiumPage>& pPage, basegfx::B2D { std::unique_ptr<vcl::pdf::PDFiumBitmap> pBitmap = pPageObject->getImageBitmap(); + if (!pBitmap) + { + continue; + } pMarker->maBitmapEx = pBitmap->createBitmapFromBuffer(); } }
