summaryrefslogtreecommitdiff
path: root/sax/source
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2011-10-15 12:11:43 +0100
committerCaolán McNamara <caolanm@redhat.com>2011-10-15 12:18:48 +0100
commitca85f280e26b9090c06b8b2092e3dde570043e16 (patch)
tree31c9140b4df9d932dcd43c5b2e01a8f8174561f5 /sax/source
parentafd6a9059bcfd6def2b4cb45198b26aa65248f21 (diff)
Fix overflow in smoketest, promotion from sal_Int32 to sal_Int64 doesn't happen before assign
Diffstat (limited to 'sax/source')
-rw-r--r--sax/source/tools/converter.cxx5
1 files changed, 3 insertions, 2 deletions
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;