vcl/headless/svpgdi.cxx | 10 ++++++++++ 1 file changed, 10 insertions(+)
New commits: commit 3a00d7bbda7c96e3c2f65427e0d1abcb9212e31a Author: Caolán McNamara <caol...@redhat.com> AuthorDate: Wed Aug 1 21:34:20 2018 +0100 Commit: Caolán McNamara <caol...@redhat.com> CommitDate: Thu Aug 2 09:53:58 2018 +0200 forcepoint#67 detect cairo surface creation failure if e.g. too large Change-Id: I7de8748a5ed695c1b3ddc8c1358414f3acd68c94 Reviewed-on: https://gerrit.libreoffice.org/58453 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caol...@redhat.com> Tested-by: Caolán McNamara <caol...@redhat.com> diff --git a/vcl/headless/svpgdi.cxx b/vcl/headless/svpgdi.cxx index bd7bb5e6d256..0b495e43eff2 100644 --- a/vcl/headless/svpgdi.cxx +++ b/vcl/headless/svpgdi.cxx @@ -1264,6 +1264,11 @@ void SvpSalGraphics::drawMask( const SalTwoRect& rTR, /** creates an image from the given rectangle, replacing all black pixels * with nMaskColor and make all other full transparent */ SourceHelper aSurface(rSalBitmap, true); // The mask is argb32 + if (!aSurface.getSurface()) + { + SAL_WARN("vcl.gdi", "unsupported SvpSalGraphics::drawMask case"); + return; + } sal_Int32 nStride; unsigned char *mask_data = aSurface.getBits(nStride); for (sal_Int32 y = rTR.mnSrcY ; y < rTR.mnSrcY + rTR.mnSrcHeight; ++y) @@ -1517,6 +1522,11 @@ cairo_surface_t* SvpSalGraphics::createCairoSurface(const BitmapBuffer *pBuffer) nFormat, pBuffer->mnWidth, pBuffer->mnHeight, pBuffer->mnScanlineSize); + if (cairo_surface_status(target) != CAIRO_STATUS_SUCCESS) + { + cairo_surface_destroy(target); + return nullptr; + } return target; } _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits