From 1f7adcdfa2d2c0838254f6823e2f3ba0d6c92746 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Mon, 22 Mar 2021 20:48:01 +0000 Subject: ofz: Integer-overflow MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit convert to double earlier Change-Id: I6d6a1bf3a09161772eb11a5ac260dc0cac2b6e0c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112944 Tested-by: Jenkins Reviewed-by: Caolán McNamara --- svx/source/customshapes/EnhancedCustomShape2d.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'svx/source/customshapes/EnhancedCustomShape2d.cxx') diff --git a/svx/source/customshapes/EnhancedCustomShape2d.cxx b/svx/source/customshapes/EnhancedCustomShape2d.cxx index 32c458df7848..c33031a86605 100644 --- a/svx/source/customshapes/EnhancedCustomShape2d.cxx +++ b/svx/source/customshapes/EnhancedCustomShape2d.cxx @@ -832,8 +832,8 @@ double EnhancedCustomShape2d::GetEnumFunc( const ExpressionFunct eFunc ) const case ExpressionFunct::EnumPi : fRet = F_PI; break; case ExpressionFunct::EnumLeft : fRet = static_cast(nCoordLeft); break; case ExpressionFunct::EnumTop : fRet = static_cast(nCoordTop); break; - case ExpressionFunct::EnumRight : fRet = static_cast(nCoordLeft + nCoordWidth) * fXRatio; break; - case ExpressionFunct::EnumBottom : fRet = static_cast(nCoordTop + nCoordHeight) * fYRatio; break; + case ExpressionFunct::EnumRight : fRet = (static_cast(nCoordLeft) + static_cast(nCoordWidth)) * fXRatio; break; + case ExpressionFunct::EnumBottom : fRet = (static_cast(nCoordTop) + static_cast(nCoordHeight)) * fYRatio; break; case ExpressionFunct::EnumXStretch : fRet = nXRef; break; case ExpressionFunct::EnumYStretch : fRet = nYRef; break; case ExpressionFunct::EnumHasStroke : fRet = bStroked ? 1.0 : 0.0; break; -- cgit