summaryrefslogtreecommitdiff
path: root/basebmp
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2013-07-18 09:43:39 +0100
committerFridrich Strba <fridrich@documentfoundation.org>2013-07-19 07:48:41 +0000
commitad04ae9dc31115a1df8dc613f84575e6ad21f31c (patch)
treecb46a11872cef3443babc26cba50c9d5c945e2a3 /basebmp
parent0685963d099f1c499bc442c22f729f88691e58ff (diff)
WaE: assuming signed overflow does not occur when assuming...
that (X + c) < X is always false [-Wstrict-overflow] (cherry picked from commit 37a3f9638315483114380a461f60abeab7809a3d) Change-Id: I63880bf27ab7e34eb9e0be682b39b80b71d65103 Reviewed-on: https://gerrit.libreoffice.org/4963 Reviewed-by: Andras Timar <atimar@suse.com> Tested-by: Andras Timar <atimar@suse.com> (cherry picked from commit 3d67253be08fba7b717332a23ffbe6f2cb6c2a53) Reviewed-on: https://gerrit.libreoffice.org/4967 Reviewed-by: Fridrich Strba <fridrich@documentfoundation.org> Tested-by: Fridrich Strba <fridrich@documentfoundation.org>
Diffstat (limited to 'basebmp')
-rw-r--r--basebmp/source/bitmapdevice.cxx11
1 files changed, 9 insertions, 2 deletions
diff --git a/basebmp/source/bitmapdevice.cxx b/basebmp/source/bitmapdevice.cxx
index 5ed17967df39..92010774f54f 100644
--- a/basebmp/source/bitmapdevice.cxx
+++ b/basebmp/source/bitmapdevice.cxx
@@ -335,8 +335,15 @@ namespace
{
if( !mpDamage )
return;
- basegfx::B2IPoint aEnd( rDamagePoint.getX() + 1,
- rDamagePoint.getY() + 1 );
+
+ sal_Int32 nX(rDamagePoint.getX());
+ sal_Int32 nY(rDamagePoint.getY());
+ if (nX < SAL_MAX_INT32)
+ ++nX;
+ if (nY < SAL_MAX_INT32)
+ ++nY;
+
+ basegfx::B2IPoint aEnd( nX, nY );
damaged( basegfx::B2IBox( rDamagePoint, aEnd ) );
}