From: Julian Smart Date: Thu, 21 Jun 2012 19:12:04 +0000 (+0000) Subject: Prevent index access error X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/a8a15de623fca2c9d62cbc66682efb743a0f0824 Prevent index access error git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71828 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/richtext/richtextbuffer.cpp b/src/richtext/richtextbuffer.cpp index 6b54b33dc3..b005494725 100644 --- a/src/richtext/richtextbuffer.cpp +++ b/src/richtext/richtextbuffer.cpp @@ -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);