summaryrefslogtreecommitdiffstats
path: root/src/popupwin.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2019-07-12 16:05:45 +0200
committerBram Moolenaar <Bram@vim.org>2019-07-12 16:05:45 +0200
commitb4207474780569bcc9840e03f13edb5d9c2554f5 (patch)
tree0dc0e386c11d123e867c0824bff7a50b37b26da1 /src/popupwin.c
parent847a5d69a826c02a7cb8a14884f3fef69d74fed7 (diff)
patch 8.1.1665: crash when popup window with mask is below the screenv8.1.1665
Problem: Crash when popup window with mask is below the screen. Solution: Correct boundary check.
Diffstat (limited to 'src/popupwin.c')
-rw-r--r--src/popupwin.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/popupwin.c b/src/popupwin.c
index 484f774067..968f6eeda4 100644
--- a/src/popupwin.c
+++ b/src/popupwin.c
@@ -2323,8 +2323,10 @@ update_popup_transparent(win_T *wp, int val)
--lines;
if (lines < 0)
lines = 0;
- for (line = lines; line < linee && line < screen_Rows; ++line)
- for (col = cols; col < cole && col < screen_Columns; ++col)
+ for (line = lines; line < linee
+ && line + wp->w_winrow < screen_Rows; ++line)
+ for (col = cols; col < cole
+ && col + wp->w_wincol < screen_Columns; ++col)
popup_transparent[(line + wp->w_winrow) * screen_Columns
+ col + wp->w_wincol] = val;
}