summaryrefslogtreecommitdiff
path: root/sd/source/filter/pdf/sdpdffilter.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'sd/source/filter/pdf/sdpdffilter.cxx')
-rw-r--r--sd/source/filter/pdf/sdpdffilter.cxx5
1 files changed, 5 insertions, 0 deletions
diff --git a/sd/source/filter/pdf/sdpdffilter.cxx b/sd/source/filter/pdf/sdpdffilter.cxx
index 6bc036f7fa21..290eea440e3c 100644
--- a/sd/source/filter/pdf/sdpdffilter.cxx
+++ b/sd/source/filter/pdf/sdpdffilter.cxx
@@ -71,12 +71,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;
+
pPage->InsertObject(pSdrGrafObj);
for (auto const& rPDFAnnotation : rPDFGraphicResult.maAnnotations)