From: Eli Zaretskii Date: Fri, 15 Jul 2022 10:49:56 +0000 (+0300) Subject: Avoid infloop in redisplay when displaying a tooltip X-Git-Tag: emacs-29.0.90~1447^2~916 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=ed4ba79ea8f2be2d01f6447910e2c8319908d0d6;p=emacs.git Avoid infloop in redisplay when displaying a tooltip * src/xdisp.c (try_window): Ensure we fail if 'display_line' indicates that the dimensions of the glyph matrix are insufficient. (Bug#56561) --- diff --git a/src/xdisp.c b/src/xdisp.c index f205327cc34..1940d16a013 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -20200,9 +20200,16 @@ try_window (Lisp_Object window, struct text_pos pos, int flags) /* Display all lines of W. */ while (it.current_y < it.last_visible_y) { + int last_row_scale = it.w->nrows_scale_factor; + int last_col_scale = it.w->ncols_scale_factor; if (display_line (&it, cursor_vpos)) last_text_row = it.glyph_row - 1; - if (f->fonts_changed && !(flags & TRY_WINDOW_IGNORE_FONTS_CHANGE)) + if (f->fonts_changed + && !((flags & TRY_WINDOW_IGNORE_FONTS_CHANGE) + /* If the matrix dimensions are insufficient, we _must_ + fail and let dispnew.c reallocate the matrix. */ + && last_row_scale == it.w->nrows_scale_factor + && last_col_scale == it.w->ncols_scale_factor)) return 0; }