From 541ea589c37c8178a3e194e6d92e11ca12afdbb0 Mon Sep 17 00:00:00 2001 From: Jaakko Keränen Date: Mon, 5 Apr 2021 13:44:15 +0300 Subject: Text: Fixed crash during word wrapping Word wrap position must not go past end of input. --- src/ui/text.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/ui') diff --git a/src/ui/text.c b/src/ui/text.c index 68dce44d..bb446440 100644 --- a/src/ui/text.c +++ b/src/ui/text.c @@ -1031,6 +1031,8 @@ static iRect run_Font_(iFont *d, const iRunArgs *args) { if (args->continueFrom_out) { if (lastWordEnd != args->text.start && ~mode & noWrapFlag_RunMode) { *args->continueFrom_out = skipSpace_CStr(lastWordEnd); + *args->continueFrom_out = iMin(*args->continueFrom_out, + args->text.end); } else { *args->continueFrom_out = currentPos; /* forced break */ -- cgit v1.2.3