From c97df0d704bfa5eebe573386445abfa4dcfd95b8 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Sat, 28 Jul 2018 16:06:14 +0100 Subject: ofz#9613 Integer-overflow in shadow multiplication MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I1c7dda7391987ea7bf5aa841aab576af0fc3759e Reviewed-on: https://gerrit.libreoffice.org/58219 Tested-by: Jenkins Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara --- editeng/source/items/frmitems.cxx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'editeng') diff --git a/editeng/source/items/frmitems.cxx b/editeng/source/items/frmitems.cxx index 951a19fc77b3..f66dfff63a63 100644 --- a/editeng/source/items/frmitems.cxx +++ b/editeng/source/items/frmitems.cxx @@ -84,6 +84,7 @@ #include #include #include +#include #include using namespace ::editeng; @@ -1127,10 +1128,10 @@ bool SvxShadowItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId ) case MID_SHADOW_TRANSPARENCE: { sal_Int32 nTransparence = 0; - if (rVal >>= nTransparence) + if ((rVal >>= nTransparence) && !o3tl::checked_multiply(nTransparence, 255, nTransparence)) { Color aColor(aShadow.Color); - aColor.SetTransparency(rtl::math::round(float(nTransparence * 255) / 100)); + aColor.SetTransparency(rtl::math::round(float(nTransparence) / 100)); aShadow.Color = sal_Int32(aColor); } break; -- cgit