mirror of
https://github.com/LibreOffice/core.git
synced 2025-08-03 18:55:02 +00:00
ofz#53028 Integer-overflow
Change-Id: I35c2731b8b6afe1d75f71e4c4b7bb12c07807faa Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142340 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
This commit is contained in:
@ -327,14 +327,14 @@ void OutputDevice::CalcHatchValues( const tools::Rectangle& rRect, tools::Long n
|
|||||||
rPt1 = rRect.TopLeft();
|
rPt1 = rRect.TopLeft();
|
||||||
rPt2 = Point( rRect.Left() - nXOff, rRect.Bottom() );
|
rPt2 = Point( rRect.Left() - nXOff, rRect.Bottom() );
|
||||||
rEndPt1 = Point( rRect.Right() + nXOff, rRect.Top() );
|
rEndPt1 = Point( rRect.Right() + nXOff, rRect.Top() );
|
||||||
nPX = FRound( aRef.X() - ( ( rPt1.Y() - aRef.Y() ) / fTan ) );
|
nPX = FRound( aRef.X() - ( (static_cast<double>(rPt1.Y()) - aRef.Y()) / fTan ) );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
rPt1 = rRect.BottomLeft();
|
rPt1 = rRect.BottomLeft();
|
||||||
rPt2 = Point( rRect.Left() - nXOff, rRect.Top() );
|
rPt2 = Point( rRect.Left() - nXOff, rRect.Top() );
|
||||||
rEndPt1 = Point( rRect.Right() + nXOff, rRect.Bottom() );
|
rEndPt1 = Point( rRect.Right() + nXOff, rRect.Bottom() );
|
||||||
nPX = FRound( aRef.X() + ( ( rPt1.Y() - aRef.Y() ) / fTan ) );
|
nPX = FRound( aRef.X() + ( (static_cast<double>(rPt1.Y()) - aRef.Y()) / fTan ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
if( nPX <= rPt1.X() )
|
if( nPX <= rPt1.X() )
|
||||||
|
Reference in New Issue
Block a user