aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorNeil <nyamatongwe@gmail.com>2026-02-25 18:02:34 +1100
committerNeil <nyamatongwe@gmail.com>2026-02-25 18:02:34 +1100
commite0279b297b16cf6c997e8732697d6755442448b1 (patch)
treea719817fd6a73ac8504c9dc6ddb5bc0b9e3bfa76 /src
parent3a96061c7eb0c3b72d68ba230a1f6e8bfc10d878 (diff)
downloadscintilla-mirror-e0279b297b16cf6c997e8732697d6755442448b1.tar.gz
Fix crash on Linux when window too narrow so rcLine is empty. Clamp(rcLine
calls std::clamp on negative range producing undefined behaviour.
Diffstat (limited to 'src')
-rw-r--r--src/EditView.cxx3
1 files changed, 3 insertions, 0 deletions
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);