sd/source/filter/pdf/sdpdffilter.cxx | 5 +++++ 1 file changed, 5 insertions(+)
New commits: commit be4961d601f4e39d2dd252e8b3ffe0a607bc789e Author: Michael Meeks <michael.me...@collabora.com> AuthorDate: Fri Jun 25 10:31:28 2021 +0100 Commit: Michael Meeks <michael.me...@collabora.com> CommitDate: Fri Jun 25 13:02:36 2021 +0200 pdf import: handle out of memory / failure to duplicate page. Avoid some reported segv's from null pages. Change-Id: Ic336b36fb57dc70fff183cd5aa5f3f3ef4562674 Signed-off-by: Michael Meeks <michael.me...@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117873 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com> diff --git a/sd/source/filter/pdf/sdpdffilter.cxx b/sd/source/filter/pdf/sdpdffilter.cxx index 4b52f9e4b574..4500a380f82e 100644 --- a/sd/source/filter/pdf/sdpdffilter.cxx +++ b/sd/source/filter/pdf/sdpdffilter.cxx @@ -77,12 +77,17 @@ bool SdPdfFilter::Import() // Create the page and insert the Graphic. SdPage* pPage = mrDocument.GetSdPage(nPageNumber, PageKind::Standard); + if (!pPage) // failed to duplicate page, out of memory? + return false; // Make the page size match the rendered image. pPage->SetSize(aSizeHMM); SdrGrafObj* pSdrGrafObj = new SdrGrafObj(pPage->getSdrModelFromSdrPage(), rGraphic, tools::Rectangle(Point(), aSizeHMM)); + if (!pSdrGrafObj) // out of memory + return false; + pSdrGrafObj->SetResizeProtect(true); pSdrGrafObj->SetMoveProtect(true); _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits