From 86b79ea1f6afb709f2de8141810a61e4162e3125 Mon Sep 17 00:00:00 2001 From: Jan Holesovsky Date: Sat, 2 Nov 2013 00:19:29 +0100 Subject: starmath: Check for text length. Fixes fdo32667-1.doc. Change-Id: Ibe7a9ca83b65e7b13c6b315f1b771f50f0b6fc7a --- starmath/source/mathtype.cxx | 6 +++--- 1 file 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," {}"); -- cgit