Kaydet (Commit) d8e7bc04 authored tarafından Stephan Bergmann's avatar Stephan Bergmann

Remove hack of replacing 0 with 1/LONG_MAX

...that hack was in there since the initial import, but it is unclear to me what
it shall fix, and it rather leads to problems as reported by
-fsanitize=signed-integer-overflow when OuptutDevice::PixelToLogic of a 1x1 Size
calls ImplPixelToLogic with n=1, nMapDenom=LONG_MAX causing the computation of
2*n64 to overflow on 64-bit Linux.

Change-Id: I2465da46175b8a1d4af1c23fb3df993230eec78d
üst a47600e1
......@@ -329,18 +329,6 @@ static void ImplCalcMapResolution( const MapMode& rMapMode,
rMapRes.mnMapScDenomX = aTempX.GetDenominator();
rMapRes.mnMapScNumY = aTempY.GetNumerator();
rMapRes.mnMapScDenomY = aTempY.GetDenominator();
// hack: 0/n approximately 1/max
if ( !rMapRes.mnMapScNumX )
{
rMapRes.mnMapScNumX = 1;
rMapRes.mnMapScDenomX = LONG_MAX;
}
if ( !rMapRes.mnMapScNumY )
{
rMapRes.mnMapScNumY = 1;
rMapRes.mnMapScDenomY = LONG_MAX;
}
}
inline void ImplCalcMapResolution( const MapMode& rMapMode,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment