diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2021-08-05 08:16:53 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2021-08-05 10:05:42 +0200 |
commit | 0dab89d88f6b42065033f64b69a6e04a31d477d6 (patch) | |
tree | f23a772fc6e1ec0cb50c320e106c0844f67ec987 /drawinglayer | |
parent | 2030e380cfcade7ca8c18da67d9703b78959be0a (diff) |
Remove harmful static_cast<int>
...that were present ever since the code's introduction in
c6df405c6c5e41212d69282d4f632893f108fda2 "#i39532#", but cause
`instdir/program/soffice --headless --convert-to pdf` of doc/abi5309-1.doc from
the crash-testing corpus to fail under UBSan with
> drawinglayer/source/processor2d/vclhelperbufferdevice.cxx:278:64: runtime error: -3.77964e+18 is outside the range of representable values of type 'int'
Change-Id: Ieff00d6fe91e2ffef46876ef308351d3689c5ffe
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120055
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'drawinglayer')
-rw-r--r-- | drawinglayer/source/processor2d/vclhelperbufferdevice.cxx | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/drawinglayer/source/processor2d/vclhelperbufferdevice.cxx b/drawinglayer/source/processor2d/vclhelperbufferdevice.cxx index a0e29d7e6942..5e995ec0627b 100644 --- a/drawinglayer/source/processor2d/vclhelperbufferdevice.cxx +++ b/drawinglayer/source/processor2d/vclhelperbufferdevice.cxx @@ -275,10 +275,8 @@ impBufferDevice::impBufferDevice(OutputDevice& rOutDev, const basegfx::B2DRange& { basegfx::B2DRange aRangePixel(rRange); aRangePixel.transform(mrOutDev.GetViewTransformation()); - const ::tools::Rectangle aRectPixel(static_cast<sal_Int32>(floor(aRangePixel.getMinX())), - static_cast<sal_Int32>(floor(aRangePixel.getMinY())), - static_cast<sal_Int32>(ceil(aRangePixel.getMaxX())), - static_cast<sal_Int32>(ceil(aRangePixel.getMaxY()))); + const ::tools::Rectangle aRectPixel(floor(aRangePixel.getMinX()), floor(aRangePixel.getMinY()), + ceil(aRangePixel.getMaxX()), ceil(aRangePixel.getMaxY())); const Point aEmptyPoint; maDestPixel = ::tools::Rectangle(aEmptyPoint, mrOutDev.GetOutputSizePixel()); maDestPixel.Intersection(aRectPixel); |