Fix overflow in smoketest, promotion from sal_Int32 to sal_Int64 doesn't happen before assign

This commit is contained in:
Caolán McNamara 2011-10-15 12:11:43 +01:00
parent afd6a9059b
commit ca85f280e2

View File

@ -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;