diff src/popupwin.c @ 17332:61f0bf94ef92 v8.1.1665

patch 8.1.1665: crash when popup window with mask is below the screen commit https://github.com/vim/vim/commit/b4207474780569bcc9840e03f13edb5d9c2554f5 Author: Bram Moolenaar <Bram@vim.org> Date: Fri Jul 12 16:05:45 2019 +0200 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.
author Bram Moolenaar <Bram@vim.org>
date Fri, 12 Jul 2019 16:15:04 +0200
parents 12c1f01b304e
children 1ac1d34bbdbf
line wrap: on
line diff
--- a/src/popupwin.c
+++ b/src/popupwin.c
@@ -2323,8 +2323,10 @@ update_popup_transparent(win_T *wp, int 
 	    --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;
 	}