summaryrefslogtreecommitdiff
path: root/vcl/source
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2022-11-05 16:03:59 +0000
committerCaolán McNamara <caolanm@redhat.com>2022-11-05 22:13:55 +0100
commitd90bf6f8c19d7c43ec83656a3a6f85a81aee573c (patch)
tree0b8a07e6fd957ad2e7d89b08922ae819d16e248c /vcl/source
parent12e468a6066894e7ff01d622343d23fccbceeb09 (diff)
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>
Diffstat (limited to 'vcl/source')
-rw-r--r--vcl/source/outdev/hatch.cxx4
1 files changed, 2 insertions, 2 deletions
diff --git a/vcl/source/outdev/hatch.cxx b/vcl/source/outdev/hatch.cxx
index 10930bbcb424..3b92f6df5de9 100644
--- a/vcl/source/outdev/hatch.cxx
+++ b/vcl/source/outdev/hatch.cxx
@@ -327,14 +327,14 @@ void OutputDevice::CalcHatchValues( const tools::Rectangle& rRect, tools::Long n
rPt1 = rRect.TopLeft();
rPt2 = Point( rRect.Left() - nXOff, rRect.Bottom() );
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
{
rPt1 = rRect.BottomLeft();
rPt2 = Point( rRect.Left() - nXOff, rRect.Top() );
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() )