summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--vcl/headless/svpgdi.cxx5
1 files changed, 5 insertions, 0 deletions
diff --git a/vcl/headless/svpgdi.cxx b/vcl/headless/svpgdi.cxx
index 5881eeacf0f0..7025edbc6a2d 100644
--- a/vcl/headless/svpgdi.cxx
+++ b/vcl/headless/svpgdi.cxx
@@ -1161,6 +1161,11 @@ SalBitmap* SvpSalGraphics::getBitmap( long nX, long nY, long nWidth, long nHeigh
pBitmap->Create(Size(nWidth, nHeight), GetBitCount(), aPal);
cairo_surface_t* target = SvpSalGraphics::createCairoSurface(pBitmap->GetBuffer());
+ if (!target)
+ {
+ SAL_WARN("vcl.gdi", "SvpSalGraphics::getBitmap, cannot create cairo surface");
+ return nullptr;
+ }
cairo_t* cr = cairo_create(target);
SalTwoRect aTR(nX, nY, nWidth, nHeight, 0, 0, nWidth, nHeight);