Kaydet (Commit) 31dcf60f authored tarafından Caolán McNamara's avatar Caolán McNamara

ofz#4576 Integer-overflow

Change-Id: I8042170ca2c3e66887374a94aa7d335e4445be69
Reviewed-on: https://gerrit.libreoffice.org/46182Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarCaolán McNamara <caolanm@redhat.com>
Tested-by: 's avatarCaolán McNamara <caolanm@redhat.com>
üst cd5a4971
......@@ -23,6 +23,7 @@
#include <com/sun/star/drawing/Hatch.hpp>
#include <com/sun/star/style/CaseMap.hpp>
#include <com/sun/star/xml/sax/XFastAttributeList.hpp>
#include <o3tl/safeint.hxx>
#include <osl/diagnose.h>
#include <sax/tools/converter.hxx>
#include <oox/token/tokens.hxx>
......@@ -40,7 +41,8 @@ namespace drawingml {
/** converts EMUs into 1/100th mmm */
sal_Int32 GetCoordinate( sal_Int32 nValue )
{
return (nValue + 180) / 360;
nValue = o3tl::saturating_add<sal_Int32>(nValue, 180);
return nValue / 360;
}
/** converts an emu string into 1/100th mmm */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment