diff options
author | Caolán McNamara <caolanm@redhat.com> | 2022-06-28 16:46:05 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2022-06-28 20:36:05 +0200 |
commit | 0b1e5f239bede5002f410a7e48c6b9092fe7ec2b (patch) | |
tree | 7ac94a0fe486a0b72af9ab28a04d39089d3ac639 | |
parent | tdf#149755 bottom of characters missing in dwrite rendered case (diff) | |
download | core-0b1e5f239bede5002f410a7e48c6b9092fe7ec2b.tar.gz core-0b1e5f239bede5002f410a7e48c6b9092fe7ec2b.zip |
ofz: Direct-leak
same issue as https://gitlab.freedesktop.org/cairo/cairo/-/issues/179
cairo_get_source returns a leaked pattern when the context passed in is
in error, so avoid the infinite stretch which creates the error
Change-Id: I239b85694773cfee77754c2f7bc819f68ef448aa
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136580
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r-- | vcl/headless/SvpGraphicsBackend.cxx | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/vcl/headless/SvpGraphicsBackend.cxx b/vcl/headless/SvpGraphicsBackend.cxx index 209e2e880c83..3907f2dd05a0 100644 --- a/vcl/headless/SvpGraphicsBackend.cxx +++ b/vcl/headless/SvpGraphicsBackend.cxx @@ -635,6 +635,12 @@ bool SvpGraphicsBackend::drawAlphaBitmap(const SalTwoRect& rTR, const SalBitmap& return false; } + if (!rTR.mnSrcWidth || !rTR.mnSrcHeight) + { + SAL_WARN("vcl.gdi", "not possible to stretch nothing"); + return true; + } + // MM02 try to access buffered BitmapHelper std::shared_ptr<BitmapHelper> aSurface; tryToUseSourceBuffer(rSourceBitmap, aSurface); |