From 3e6849bccbe097f4ff6a52d9f5e44db5f392acbd Mon Sep 17 00:00:00 2001 From: Po Lu Date: Tue, 16 Apr 2024 14:54:32 +0800 Subject: [PATCH] Another fix for bug#70385 * src/xdisp.c (note_fringe_highlight): Test that vpos falls within W->current_matrix. (bug#70385) (cherry picked from commit c59e67a41c512467a54cc92ed0fdb6c3b9e9ace8) --- src/xdisp.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/xdisp.c b/src/xdisp.c index d984c12d1aa..b154211cc3c 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -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; -- 2.39.5