From 288e02549bed317730eff0d169f6bdb75c8f40ce Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Mon, 23 Mar 2020 20:02:50 +0000 Subject: Resolves: tdf#131507 createCairoSurface returns nullptr on failure MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I05190a6f280ebbe750dfda56ef27d3362222b95f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90940 Tested-by: Jenkins Reviewed-by: Caolán McNamara --- vcl/headless/svpgdi.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vcl/headless/svpgdi.cxx b/vcl/headless/svpgdi.cxx index 6a5a7a23bfac..4f80ae366bfd 100644 --- a/vcl/headless/svpgdi.cxx +++ b/vcl/headless/svpgdi.cxx @@ -374,7 +374,7 @@ namespace unsigned long nTargetWidth = 0, unsigned long nTargetHeight = 0) const { - if(bDisableDownScale || 0 == nTargetWidth || 0 == nTargetHeight || isTrivial()) + if (bDisableDownScale || 0 == nTargetWidth || 0 == nTargetHeight || !pSurface || isTrivial()) { // caller asks for original or disabled or trivial (smaller then a minimal square size) // also excludes zero cases for width/height after this point if need to prescale -- cgit