]> git.saurik.com Git - wxWidgets.git/commitdiff
Prevent index access error
authorJulian Smart <julian@anthemion.co.uk>
Thu, 21 Jun 2012 19:12:04 +0000 (19:12 +0000)
committerJulian Smart <julian@anthemion.co.uk>
Thu, 21 Jun 2012 19:12:04 +0000 (19:12 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71828 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/richtext/richtextbuffer.cpp

index 6b54b33dc359c1700776e4188f9c9c25ccd86a37..b0054947250981a5f4befc0d27f35ad4c4d8d044 100644 (file)
@@ -4831,7 +4831,7 @@ bool wxRichTextParagraph::Layout(wxDC& dc, wxRichTextDrawingContext& context, co
 
             // Line end position shouldn't be the same as the end, or greater.
             if (wrapPosition >= GetRange().GetEnd())
-                wrapPosition = GetRange().GetEnd()-1;
+                wrapPosition = wxMax(0, GetRange().GetEnd()-1);
 
             // wxLogDebug(wxT("Split at %ld"), wrapPosition);