diff options
author | Caolán McNamara <caolanm@redhat.com> | 2017-10-25 14:22:04 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2017-10-25 21:29:41 +0200 |
commit | ad4ca547e57858d0051d89f1b4799ed8cbbe2ffa (patch) | |
tree | 7d8a11d23df0884241e749a2183bf56788074bb9 | |
parent | 06533a4b9d2d249e2e16c6870de9ff29d590bb96 (diff) |
ofz#3803 Integer-overflow
Change-Id: Id10ab04340449c990d384041dd6631ba84c5296f
Reviewed-on: https://gerrit.libreoffice.org/43836
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r-- | filter/source/msfilter/svdfppt.cxx | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/filter/source/msfilter/svdfppt.cxx b/filter/source/msfilter/svdfppt.cxx index 373ec9aaa7ff..64576db867cf 100644 --- a/filter/source/msfilter/svdfppt.cxx +++ b/filter/source/msfilter/svdfppt.cxx @@ -120,6 +120,7 @@ #include <svtools/embedhlp.hxx> #include <o3tl/enumrange.hxx> #include <o3tl/make_unique.hxx> +#include <o3tl/safeint.hxx> #include <boost/optional.hpp> #include <algorithm> @@ -833,11 +834,15 @@ SdrObject* SdrEscherImport::ProcessObj( SvStream& rSt, DffObjData& rObjData, voi } } sal_Int32 nFontDirection = GetPropertyValue( DFF_Prop_cdirFont, mso_cdir0 ); - nTextRotationAngle -= nFontDirection * 9000; if ( ( nFontDirection == 1 ) || ( nFontDirection == 3 ) ) { bVerticalText = !bVerticalText; } + const bool bFail = o3tl::checked_multiply(nFontDirection, 9000, nFontDirection); + if (!bFail) + nTextRotationAngle -= nFontDirection; + else + SAL_WARN("filter.ms", "Parsing error: bad fontdirection: " << nFontDirection); aTextObj.SetVertical( bVerticalText ); if ( pRet ) { |