From a8a15de623fca2c9d62cbc66682efb743a0f0824 Mon Sep 17 00:00:00 2001 From: Julian Smart Date: Thu, 21 Jun 2012 19:12:04 +0000 Subject: [PATCH] Prevent index access error git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71828 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/richtext/richtextbuffer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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); -- 2.47.2