From ca85f280e26b9090c06b8b2092e3dde570043e16 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Sat, 15 Oct 2011 12:11:43 +0100 Subject: Fix overflow in smoketest, promotion from sal_Int32 to sal_Int64 doesn't happen before assign --- sax/source/tools/converter.cxx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'sax/source') diff --git a/sax/source/tools/converter.cxx b/sax/source/tools/converter.cxx index 092e82df6281..e9a08c4b7d52 100644 --- a/sax/source/tools/converter.cxx +++ b/sax/source/tools/converter.cxx @@ -400,8 +400,9 @@ void Converter::convertMeasure( OUStringBuffer& rBuffer, break; } - OSL_ENSURE(nMeasure <= SAL_MAX_INT64 / nMul, "convertMeasure: overflow"); - sal_Int64 nValue = nMeasure * nMul; + sal_Int64 nValue = nMeasure; + OSL_ENSURE(nValue <= SAL_MAX_INT64 / nMul, "convertMeasure: overflow"); + nValue *= nMul; nValue /= nDiv; nValue += 5; nValue /= 10; -- cgit