diff options
-rw-r--r-- | starmath/source/mathtype.cxx | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/starmath/source/mathtype.cxx b/starmath/source/mathtype.cxx index 58053e48cc00..d8c93ef88404 100644 --- a/starmath/source/mathtype.cxx +++ b/starmath/source/mathtype.cxx @@ -606,9 +606,9 @@ int MathType::Parse(SotStorage *pStor) static void lcl_PrependDummyTerm(OUString &rRet, sal_Int32 &rTextStart) { - if ((rRet[rTextStart] == '=') && - ((rTextStart == 0) || - (rRet[ rTextStart-1 ] == '{')) + if ((rTextStart < rRet.getLength()) && + (rRet[rTextStart] == '=') && + ((rTextStart == 0) || (rRet[ rTextStart-1 ] == '{')) ) { rRet = rRet.replaceAt(rTextStart,0," {}"); |