[Libreoffice-commits] core.git: sw/source
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Fri Mar 1 09:42:02 UTC 2019
sw/source/filter/ww8/ww8par6.cxx | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
New commits:
commit ee049546ba57ce72610f2ac300c370fc789fe41f
Author: Stephan Bergmann <sbergman at redhat.com>
AuthorDate: Fri Mar 1 09:24:31 2019 +0100
Commit: Stephan Bergmann <sbergman at redhat.com>
CommitDate: Fri Mar 1 10:41:32 2019 +0100
Avoid unnecessary truncation to sal_uInt16
At least when CppunitTest_sw_filters_test tries to load
sw/qa/core/data/ww6/pass/crash-2.doc, Clang's
-fsanitize=implicit-signed-integer-truncation flags an "implicit conversion from
type 'unsigned int' of value 49197 (32-bit, unsigned) to type 'short' changed
the value to -16339 (16-bit, signed)" when multiplying nFSize by 10. That
document is obviously broken, LO emits lots of SAL_WARN like
"sw/source/filter/ww8/ww8scan.cxx:802: Unknown ww7- sprm, dangerous, report to
development", and at least MS Word for Mac Version 16.21 refuses to open it at
all. But even if the value of nFSize computed here is obviously way too large,
that variable is only passed into SvxFontHeightItem's sal_uLong nSz parameter,
so it can just as well be of type sal_uLong too.
Change-Id: I2e3b9152adce9c928df2276ebb2e9d526553e541
Reviewed-on: https://gerrit.libreoffice.org/68538
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman at redhat.com>
diff --git a/sw/source/filter/ww8/ww8par6.cxx b/sw/source/filter/ww8/ww8par6.cxx
index 6cced653b857..c9d042205016 100644
--- a/sw/source/filter/ww8/ww8par6.cxx
+++ b/sw/source/filter/ww8/ww8par6.cxx
@@ -3900,7 +3900,7 @@ void SwWW8ImplReader::Read_FontSize( sal_uInt16 nId, const sal_uInt8* pData, sho
else
{
// Font-Size in half points e.g. 10 = 1440 / ( 72 * 2 )
- sal_uInt16 nFSize = eVersion <= ww::eWW2 ? *pData : SVBT16ToShort(pData);
+ sal_uLong nFSize = eVersion <= ww::eWW2 ? *pData : SVBT16ToShort(pData);
nFSize*= 10;
SvxFontHeightItem aSz( nFSize, 100, nId );
More information about the Libreoffice-commits
mailing list