0
0
mirror of https://github.com/vim/vim.git synced 2025-09-24 03:44:06 -04:00

patch 8.1.1665: crash when popup window with mask is below the screen

Problem:    Crash when popup window with mask is below the screen.
Solution:   Correct boundary check.
This commit is contained in:
Bram Moolenaar
2019-07-12 16:05:45 +02:00
parent 847a5d69a8
commit b420747478
4 changed files with 23 additions and 2 deletions

View File

@@ -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;
}