diff options
author | Jaakko Keränen <jaakko.keranen@iki.fi> | 2021-04-05 13:44:15 +0300 |
---|---|---|
committer | Jaakko Keränen <jaakko.keranen@iki.fi> | 2021-04-05 13:44:15 +0300 |
commit | 541ea589c37c8178a3e194e6d92e11ca12afdbb0 (patch) | |
tree | b0d3f82fc0bfaeeca9a1925aed60a58b2deea385 | |
parent | d092640ba7eb18fe0f7a9f3af058590f893ebc34 (diff) |
Text: Fixed crash during word wrapping
Word wrap position must not go past end of input.
-rw-r--r-- | src/ui/text.c | 2 |
1 files changed, 2 insertions, 0 deletions
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) { | |||
1031 | if (args->continueFrom_out) { | 1031 | if (args->continueFrom_out) { |
1032 | if (lastWordEnd != args->text.start && ~mode & noWrapFlag_RunMode) { | 1032 | if (lastWordEnd != args->text.start && ~mode & noWrapFlag_RunMode) { |
1033 | *args->continueFrom_out = skipSpace_CStr(lastWordEnd); | 1033 | *args->continueFrom_out = skipSpace_CStr(lastWordEnd); |
1034 | *args->continueFrom_out = iMin(*args->continueFrom_out, | ||
1035 | args->text.end); | ||
1034 | } | 1036 | } |
1035 | else { | 1037 | else { |
1036 | *args->continueFrom_out = currentPos; /* forced break */ | 1038 | *args->continueFrom_out = currentPos; /* forced break */ |