summaryrefslogtreecommitdiff
path: root/starmath
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2022-04-30 20:03:51 +0100
committerCaolán McNamara <caolanm@redhat.com>2022-05-01 15:42:56 +0200
commitcd9602dcc51a7ce54fadf9796642ee9d7fcf3cfe (patch)
tree62609ddfe299ce16521762a348a08562ee059f82 /starmath
parentce17ecbfa6f578debcf8aec9d6c29836adb49c6f (diff)
ofz#47162 Integer-overflow
Change-Id: I4d910a1844100415f95c89bda83843ddffdc3df0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133663 Tested-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'starmath')
-rw-r--r--starmath/source/node.cxx6
1 files changed, 6 insertions, 0 deletions
diff --git a/starmath/source/node.cxx b/starmath/source/node.cxx
index a13f5deada56..c4c013b15725 100644
--- a/starmath/source/node.cxx
+++ b/starmath/source/node.cxx
@@ -782,6 +782,12 @@ void SmRootNode::Arrange(OutputDevice &rDev, const SmFormat &rFormat)
nHeight += rFormat.GetDistance(DIS_ROOT)
* GetFont().GetFontSize().Height() / 100;
+ if (nHeight < 0)
+ {
+ SAL_WARN("starmath", "negative height");
+ nHeight = 0;
+ }
+
// font specialist advised to change the width first
pRootSym->AdaptToY(rDev, nHeight);
pRootSym->AdaptToX(rDev, pBody->GetItalicWidth());