]> git.eshelyaron.com Git - emacs.git/commitdiff
Another fix for bug#70385
authorPo Lu <luangruo@yahoo.com>
Tue, 16 Apr 2024 06:54:32 +0000 (14:54 +0800)
committerEshel Yaron <me@eshelyaron.com>
Sat, 20 Apr 2024 11:01:53 +0000 (14:01 +0300)
* src/xdisp.c (note_fringe_highlight): Test that vpos falls
within W->current_matrix.  (bug#70385)

(cherry picked from commit c59e67a41c512467a54cc92ed0fdb6c3b9e9ace8)

src/xdisp.c

index d984c12d1aad181c9f0efe2e14e7163cc8b95110..b154211cc3c483ea03e93bec9f95aaf97ffb14de 100644 (file)
@@ -35769,9 +35769,11 @@ note_fringe_highlight (struct frame *f, Lisp_Object window, int x, int y,
   struct window *w = XWINDOW (window);
   x_y_to_hpos_vpos (w, x, y, &hpos, &vpos, 0, 0, &area);
 
-  /* Don't access the TEXT_AREA of a row that does not display text, or
-     when the window is outdated.  (bug#70385) */
+  /* Don't access the TEXT_AREA of a row that does not display text,
+     when the window is outdated, or when vpos overflows the current
+     matrix.  (bug#70385) */
   if (window_outdated (w)
+      || (vpos >= w->current_matrix->nrows)
       || !MATRIX_ROW_DISPLAYS_TEXT_P (MATRIX_ROW (w->current_matrix,
                                                  vpos)))
     return;