diff options
author | Caolán McNamara <caolanm@redhat.com> | 2017-12-22 09:18:30 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2017-12-22 20:07:21 +0100 |
commit | e39245e2c5000241078a557d3b49da254da7effd (patch) | |
tree | 70e50a1a7157e437c4a38bec3c2370eaf52b84ed /filter | |
parent | 5f4a49d7bc489b5e0b5ab1cd10f5c0bde7f5fee4 (diff) |
ofz#4715 Integer-overflow
Change-Id: I0ad24024db97e5e0aa9bed0d52f72f6fb6590513
Reviewed-on: https://gerrit.libreoffice.org/46954
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'filter')
-rw-r--r-- | filter/source/graphicfilter/icgm/actimpr.cxx | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/filter/source/graphicfilter/icgm/actimpr.cxx b/filter/source/graphicfilter/icgm/actimpr.cxx index 9a0762905bab..7c382906fe0c 100644 --- a/filter/source/graphicfilter/icgm/actimpr.cxx +++ b/filter/source/graphicfilter/icgm/actimpr.cxx @@ -20,6 +20,7 @@ #include <sal/config.h> #include <o3tl/any.hxx> +#include <o3tl/safeint.hxx> #include <vcl/bitmapex.hxx> #include <com/sun/star/drawing/XDrawPagesSupplier.hpp> #include <com/sun/star/drawing/LineStyle.hpp> @@ -719,14 +720,14 @@ void CGMImpressOutAct::DrawText( awt::Point const & rTextPos, awt::Size const & { case TAV_HALF : { - aTextPos.Y -= static_cast<sal_Int32>( ( mpCGM->pElement->nCharacterHeight * 1.5 ) / 2 ); + aTextPos.Y = o3tl::saturating_add(aTextPos.X, static_cast<sal_Int32>((mpCGM->pElement->nCharacterHeight * -1.5) / 2)); } break; case TAV_BASE : case TAV_BOTTOM : case TAV_NORMAL : - aTextPos.Y -= static_cast<sal_Int32>( mpCGM->pElement->nCharacterHeight * 1.5 ); + aTextPos.Y = o3tl::saturating_add(aTextPos.Y, static_cast<sal_Int32>(mpCGM->pElement->nCharacterHeight * -1.5)); break; case TAV_TOP : break; |