Fix overflow in smoketest, promotion from sal_Int32 to sal_Int64 doesn't happen before assign
This commit is contained in:
@@ -400,8 +400,9 @@ void Converter::convertMeasure( OUStringBuffer& rBuffer,
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
OSL_ENSURE(nMeasure <= SAL_MAX_INT64 / nMul, "convertMeasure: overflow");
|
sal_Int64 nValue = nMeasure;
|
||||||
sal_Int64 nValue = nMeasure * nMul;
|
OSL_ENSURE(nValue <= SAL_MAX_INT64 / nMul, "convertMeasure: overflow");
|
||||||
|
nValue *= nMul;
|
||||||
nValue /= nDiv;
|
nValue /= nDiv;
|
||||||
nValue += 5;
|
nValue += 5;
|
||||||
nValue /= 10;
|
nValue /= 10;
|
||||||
|
Reference in New Issue
Block a user