patch 8.2.2510: internal error when popup with mask is zero height or width
Problem: Internal error when popup with mask is zero height or width.
Solution: Bail out if width or height is zero. (closes #7831)
diff --git a/src/popupwin.c b/src/popupwin.c
index b089552..1122f48 100644
--- a/src/popupwin.c
+++ b/src/popupwin.c
@@ -3331,8 +3331,12 @@
char_u *cells;
int row, col;
- if (wp->w_popup_mask == NULL)
+ if (wp->w_popup_mask == NULL || width == 0 || height == 0)
+ {
+ vim_free(wp->w_popup_mask_cells);
+ wp->w_popup_mask_cells = NULL;
return;
+ }
if (wp->w_popup_mask_cells != NULL
&& wp->w_popup_mask_height == height
&& wp->w_popup_mask_width == width)