[Libreoffice-commits] core.git: vcl/headless
Caolán McNamara
caolanm at redhat.com
Wed Sep 6 08:30:12 UTC 2017
vcl/headless/svpgdi.cxx | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
New commits:
commit af53581cd12a4d265719acca0c59fb4490e15951
Author: Caolán McNamara <caolanm at redhat.com>
Date: Wed Sep 6 09:27:22 2017 +0100
ofz#3028 check bitmap creation for failure
Change-Id: I8c1a2c3873e53153564a5aabc4cc8903622cf054
diff --git a/vcl/headless/svpgdi.cxx b/vcl/headless/svpgdi.cxx
index 5b8c0a8a66e0..dea4185abea8 100644
--- a/vcl/headless/svpgdi.cxx
+++ b/vcl/headless/svpgdi.cxx
@@ -1152,7 +1152,13 @@ SalBitmap* SvpSalGraphics::getBitmap( long nX, long nY, long nWidth, long nHeigh
aPal[0] = Color(COL_BLACK);
aPal[1] = Color(COL_WHITE);
}
- pBitmap->Create(Size(nWidth, nHeight), GetBitCount(), aPal);
+
+ if (!pBitmap->Create(Size(nWidth, nHeight), GetBitCount(), aPal))
+ {
+ SAL_WARN("vcl.gdi", "SvpSalGraphics::getBitmap, cannot create bitmap");
+ delete pBitmap;
+ return nullptr;
+ }
cairo_surface_t* target = SvpSalGraphics::createCairoSurface(pBitmap->GetBuffer());
cairo_t* cr = cairo_create(target);
More information about the Libreoffice-commits
mailing list