diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-01-26 09:50:06 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-04-03 10:37:51 +0200 |
commit | 8bc951daf79decbd8a599a409c6d33c5456710e0 (patch) | |
tree | 61d220d83e90a176fbcbe667827eee4b9631a4ca /emfio | |
parent | 10eefdfa6c0250c6069e641e404f34e5a91fe993 (diff) |
long->sal_Int32 in tools/gen.hxx
which triggered a lot of changes in sw/
Change-Id: Ia2aa22ea3f76463a85ea077a411246fcfed00bf6
Reviewed-on: https://gerrit.libreoffice.org/48806
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'emfio')
-rw-r--r-- | emfio/source/reader/emfreader.cxx | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/emfio/source/reader/emfreader.cxx b/emfio/source/reader/emfreader.cxx index 1d62fb1e342d..e1cf68d5669e 100644 --- a/emfio/source/reader/emfreader.cxx +++ b/emfio/source/reader/emfreader.cxx @@ -750,6 +750,9 @@ namespace emfio case EMR_SETWINDOWEXTEX : { mpInputStream->ReadUInt32( nW ).ReadUInt32( nH ); + // clamp to valid range + nW = std::max<sal_Int32>(std::min<sal_Int32>(nW, RECT_MAX), RECT_MIN); + nH = std::max<sal_Int32>(std::min<sal_Int32>(nH, RECT_MAX), RECT_MIN); SetWinExt( Size( nW, nH ), true); } break; @@ -1926,6 +1929,11 @@ namespace emfio SetrclFrame(rclFrame); SetrclBounds(rclBounds); + // clamp to valid range + nPixX = std::max<sal_Int32>(std::min<sal_Int32>(nPixX, RECT_MAX), RECT_MIN); + nPixY = std::max<sal_Int32>(std::min<sal_Int32>(nPixY, RECT_MAX), RECT_MIN); + nMillX = std::max<sal_Int32>(std::min<sal_Int32>(nMillX, RECT_MAX), RECT_MIN); + nMillY = std::max<sal_Int32>(std::min<sal_Int32>(nMillY, RECT_MAX), RECT_MIN); SetRefPix(Size( nPixX, nPixY ) ); SetRefMill(Size( nMillX, nMillY ) ); |