fixes #10686 infinite loop when entering [COLOR in an edit control
authorJonathan Marshall <jmarshall@never.you.mind>
Wed, 16 Feb 2011 22:11:53 +0000 (11:11 +1300)
committertheuni <theuni-nospam-@xbmc.org>
Thu, 17 Feb 2011 22:12:17 +0000 (17:12 -0500)
(cherry picked from commit a54451c1afca047424ae7cc39c3cc2b2d5a18887)

guilib/GUITextLayout.cpp

index 2eb676c..3a77b75 100644 (file)
@@ -399,7 +399,8 @@ void CGUITextLayout::ParseText(const CStdStringW &text, uint32_t defaultStyle, v
         colorStack.pop();
         newColor = colorStack.top();
       }
-      pos = finish + 1;
+      if (finish != CStdString::npos)
+        pos = finish + 1;
     }
 
     if (newStyle || newColor != currentColor || newLine)