From e0279b297b16cf6c997e8732697d6755442448b1 Mon Sep 17 00:00:00 2001 From: Neil Date: Wed, 25 Feb 2026 18:02:34 +1100 Subject: Fix crash on Linux when window too narrow so rcLine is empty. Clamp(rcLine calls std::clamp on negative range producing undefined behaviour. --- src/EditView.cxx | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/EditView.cxx') diff --git a/src/EditView.cxx b/src/EditView.cxx index b2895d97c..2608f11e5 100644 --- a/src/EditView.cxx +++ b/src/EditView.cxx @@ -922,6 +922,9 @@ void DrawTextBlob(Surface *surface, const ViewStyle &vsDraw, PRectangle rcSegmen void FillLineRemainder(Surface *surface, const EditModel &model, const ViewStyle &vsDraw, const LineLayout *ll, Sci::Line line, PRectangle rcLine, XYPOSITION left, int subLine) { + if (rcLine.Empty()) { + return; + } InSelection eolInSelection = InSelection::inNone; if (vsDraw.selection.visible && (subLine == (ll->lines - 1))) { eolInSelection = model.LineEndInSelection(line); -- cgit v1.2.3