textrendering/textformatting/tagma/TMGLYPH.CPP
changeset 44 601ab138ba0b
parent 37 6be019398652
child 55 336bee5c2d35
--- a/textrendering/textformatting/tagma/TMGLYPH.CPP	Fri Jun 11 15:33:54 2010 +0300
+++ b/textrendering/textformatting/tagma/TMGLYPH.CPP	Tue Jul 06 16:23:19 2010 +0300
@@ -19,6 +19,11 @@
 
 #include "TMSTD.H"
 #include <bidi.h>
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "TMGLYPHTraces.h"
+#endif
+
 
 
 inline TBool IsSurrogate(TText a) { return 0xD800 == (a & 0xF800); }
@@ -312,6 +317,10 @@
 		TPtrC text;
 		aSource.GetText(aStart, text, dummy);
 		TInt textEnd = aStart + text.Length();
+		if (aStart >= textEnd)
+		    {
+		    OstTrace0( TRACE_FATAL, DUP1__APPENDTEXTTOBUFFER, "EZeroLengthTextSupplied" );
+		    }
 		__ASSERT_ALWAYS(aStart < textEnd, TmPanic(EZeroLengthTextSupplied));
 		if (aEnd < textEnd)
 			{
@@ -413,6 +422,10 @@
 									TDisplayedTextDirectionality aDirectionality, TText* aBuffer,TUint aContextChar,
 									TTmCharFormat* aFormat, CTmTextFontCache** aFont)
 	{
+	if (aStart > aEnd)
+	    {
+	    OstTrace0( TRACE_DUMP, RTMTEXTCACHE_GETDISPLAYEDTEXT, "EBadArg" );
+	    }
 	__ASSERT_DEBUG(aStart <= aEnd, TmPanic(EBadArg));
 	if (aContextChar == 0)
 		aBuffer[0] = 0xFFFF;