summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2018-01-07 15:03:04 +0000
committerCaolán McNamara <caolanm@redhat.com>2018-01-08 09:51:25 +0100
commit0ef0740298b45379bbf8d00d50beffee7a2f812a (patch)
treec4031badacf89536de4e28850b06fe243d7336d3
parent2d771c81d1292ea20f954364a0b8f34875973a17 (diff)
ofz#5015 Integer-overflow
Change-Id: Id5b8e3b66b5b7b0f762c72a3e66e6c425011301c Reviewed-on: https://gerrit.libreoffice.org/47534 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r--sw/source/filter/html/svxcss1.cxx8
1 files changed, 4 insertions, 4 deletions
diff --git a/sw/source/filter/html/svxcss1.cxx b/sw/source/filter/html/svxcss1.cxx
index 392e02addbc0..37c0a88df992 100644
--- a/sw/source/filter/html/svxcss1.cxx
+++ b/sw/source/filter/html/svxcss1.cxx
@@ -2592,11 +2592,11 @@ static void ParseCSS1_border_xxx( const CSS1Expression *pExpr,
bool bHori = nWhichLine == SvxBoxItemLine::TOP ||
nWhichLine == SvxBoxItemLine::BOTTOM;
// One Pixel becomes a hairline (is prettier)
- long nWidthL = (long)pExpr->GetNumber();
- if( nWidthL > 1 )
+ double fWidth = pExpr->GetNumber();
+ if (fWidth > 1.0 && fWidth < SAL_MAX_INT32/2.0)
{
- long nPWidth = bHori ? 0 : nWidthL;
- long nPHeight = bHori ? nWidthL : 0;
+ long nPWidth = bHori ? 0 : fWidth;
+ long nPHeight = bHori ? fWidth : 0;
SvxCSS1Parser::PixelToTwip( nPWidth, nPHeight );
nWidth = (sal_uInt16)(bHori ? nPHeight : nPWidth);
}