summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2014-11-25 16:42:49 +0100
committerMichael Stahl <mstahl@redhat.com>2014-11-25 18:09:39 +0100
commit52ce5239b43bf6b9ce1ceddfe90227920aa57657 (patch)
tree1f16fa39a1d8741de0a26118a8894aad1374ca40
parentd288ee633d7964cf89a32a96e6e0af8c3c3e0db9 (diff)
vcl: assert when LogicToPixel overflows
Change-Id: I86d1c3e0c177c671b280c05b47312c79389884ed
-rw-r--r--sw/source/core/layout/pagechg.cxx2
-rw-r--r--vcl/source/outdev/map.cxx2
2 files changed, 3 insertions, 1 deletions
diff --git a/sw/source/core/layout/pagechg.cxx b/sw/source/core/layout/pagechg.cxx
index f04216834771..43ed48e85ba1 100644
--- a/sw/source/core/layout/pagechg.cxx
+++ b/sw/source/core/layout/pagechg.cxx
@@ -2177,7 +2177,7 @@ void SwRootFrm::CheckViewLayout( const SwViewOption* pViewOpt, const SwRect* pVi
pSh->SetFirstVisPageInvalid();
if (bOldCallbackActionEnabled)
{
- pSh->InvalidateWindows( SwRect( 0, 0, LONG_MAX, LONG_MAX ) );
+ pSh->InvalidateWindows( SwRect( 0, 0, INT_MAX, INT_MAX ) );
pSh->GetDoc()->GetDocShell()->Broadcast(SfxSimpleHint(SFX_HINT_DOCCHANGED));
}
}
diff --git a/vcl/source/outdev/map.cxx b/vcl/source/outdev/map.cxx
index b8bc6c5b05a1..51174717f221 100644
--- a/vcl/source/outdev/map.cxx
+++ b/vcl/source/outdev/map.cxx
@@ -381,6 +381,8 @@ static long ImplLogicToPixel( long n, long nDPI, long nMapNum, long nMapDenom,
}
}
else
+#else
+ assert(n < std::numeric_limits<long>::max() / nMapNum); //detect overflows
#endif
{
sal_Int64 n64 = n;