summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2023-05-11 09:05:48 +0100
committerCaolán McNamara <caolanm@redhat.com>2023-05-11 12:56:35 +0200
commitba63c4199d19b87d53bb167397180fc2d8686ff5 (patch)
tree6e2720081c6a0f98e5fb7a8afe2f3e0f1ad89d49 /vcl
parent662840c33d7736a8d873b2c53f6d0cb6dd3b2998 (diff)
ofz#58818 Direct-leak
Change-Id: I8974b998397aa521c9ee61651b5ce45d4189b303 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151662 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'vcl')
-rw-r--r--vcl/headless/CairoCommon.cxx15
1 files changed, 15 insertions, 0 deletions
diff --git a/vcl/headless/CairoCommon.cxx b/vcl/headless/CairoCommon.cxx
index 2b732f627f30..d9c77afa1e56 100644
--- a/vcl/headless/CairoCommon.cxx
+++ b/vcl/headless/CairoCommon.cxx
@@ -879,6 +879,13 @@ bool CairoCommon::drawPolyPolygon(const basegfx::B2DHomMatrix& rObjectToDevice,
return true;
cairo_t* cr = getCairoContext(true, bAntiAlias);
+ if (cairo_status(cr) != CAIRO_STATUS_SUCCESS)
+ {
+ SAL_WARN("vcl.gdi",
+ "cannot render to surface: " << cairo_status_to_string(cairo_status(cr)));
+ releaseCairoContext(cr, true, basegfx::B2DRange());
+ return true;
+ }
clipRegion(cr);
// Set full (Object-to-Device) transformation - if used
@@ -1648,6 +1655,14 @@ bool CairoCommon::drawAlphaBitmap(const SalTwoRect& rTR, const SalBitmap& rSourc
}
cairo_t* cr = getCairoContext(false, bAntiAlias);
+ if (cairo_status(cr) != CAIRO_STATUS_SUCCESS)
+ {
+ SAL_WARN("vcl.gdi",
+ "cannot render to surface: " << cairo_status_to_string(cairo_status(cr)));
+ releaseCairoContext(cr, false, basegfx::B2DRange());
+ return true;
+ }
+
clipRegion(cr);
cairo_rectangle(cr, rTR.mnDestX, rTR.mnDestY, rTR.mnDestWidth, rTR.mnDestHeight);