[Libreoffice-commits] core.git: vcl/headless
Caolán McNamara
caolanm at redhat.com
Thu Jul 13 12:39:14 UTC 2017
vcl/headless/svpbmp.cxx | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
New commits:
commit 1487b26a150b898a61b201e849e2f18f7f14de4c
Author: Caolán McNamara <caolanm at redhat.com>
Date: Sat Jun 17 21:16:34 2017 +0100
ofz#2287 check multiply
Change-Id: Ibc4c93ac1f5686a476b5e303347dc951daa58e33
Reviewed-on: https://gerrit.libreoffice.org/38909
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm at redhat.com>
Tested-by: Caolán McNamara <caolanm at redhat.com>
diff --git a/vcl/headless/svpbmp.cxx b/vcl/headless/svpbmp.cxx
index 15c6fc9c1022..b8c70123a39b 100644
--- a/vcl/headless/svpbmp.cxx
+++ b/vcl/headless/svpbmp.cxx
@@ -132,8 +132,10 @@ BitmapBuffer* ImplCreateDIB(
pDIB->maPalette.SetEntryCount( nColors );
}
- const size_t size = pDIB->mnScanlineSize * pDIB->mnHeight;
- if (size > SAL_MAX_INT32/2)
+ size_t size;
+ bFail = o3tl::checked_multiply<size_t>(pDIB->mnHeight, pDIB->mnScanlineSize, size);
+ SAL_WARN_IF(bFail, "vcl.gdi", "checked multiply failed");
+ if (bFail || size > SAL_MAX_INT32/2)
{
delete pDIB;
return nullptr;
More information about the Libreoffice-commits
mailing list