diff options
| author | Eli Zaretskii | 2025-01-21 14:24:57 +0200 |
|---|---|---|
| committer | Eli Zaretskii | 2025-01-21 14:24:57 +0200 |
| commit | 77386412050fa348940bf83c5d736ff7b745d5d8 (patch) | |
| tree | 9f1b9b1d84096870398acecaaa0fc2f3fb04b771 /src | |
| parent | 0e3687e6006ea93603a032056c6af99a242c6af5 (diff) | |
| download | emacs-77386412050fa348940bf83c5d736ff7b745d5d8.tar.gz emacs-77386412050fa348940bf83c5d736ff7b745d5d8.zip | |
Avoid crashes in redisplay due to problematic font setups
* src/xdisp.c (handle_single_display_spec)
(produce_stretch_glyph): Avoid crashes if a face's font is NULL.
(Bug#75725)
Diffstat (limited to 'src')
| -rw-r--r-- | src/xdisp.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/xdisp.c b/src/xdisp.c index 19ce5b74b01..f11a8aa6d55 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -6111,7 +6111,9 @@ handle_single_display_spec (struct it *it, Lisp_Object spec, Lisp_Object object, | |||
| 6111 | { | 6111 | { |
| 6112 | struct face *face = FACE_FROM_ID (it->f, it->face_id); | 6112 | struct face *face = FACE_FROM_ID (it->f, it->face_id); |
| 6113 | it->voffset = - (XFLOATINT (value) | 6113 | it->voffset = - (XFLOATINT (value) |
| 6114 | * (normal_char_height (face->font, -1))); | 6114 | * (face->font |
| 6115 | ? normal_char_height (face->font, -1) | ||
| 6116 | : FRAME_LINE_HEIGHT (it->f))); | ||
| 6115 | } | 6117 | } |
| 6116 | #endif /* HAVE_WINDOW_SYSTEM */ | 6118 | #endif /* HAVE_WINDOW_SYSTEM */ |
| 6117 | } | 6119 | } |
| @@ -32056,7 +32058,8 @@ produce_stretch_glyph (struct it *it) | |||
| 32056 | /* Compute height. */ | 32058 | /* Compute height. */ |
| 32057 | if (FRAME_WINDOW_P (it->f)) | 32059 | if (FRAME_WINDOW_P (it->f)) |
| 32058 | { | 32060 | { |
| 32059 | int default_height = normal_char_height (font, ' '); | 32061 | int default_height = |
| 32062 | font ? normal_char_height (font, ' ') : FRAME_LINE_HEIGHT (it->f); | ||
| 32060 | 32063 | ||
| 32061 | if ((prop = plist_get (plist, QCheight), !NILP (prop)) | 32064 | if ((prop = plist_get (plist, QCheight), !NILP (prop)) |
| 32062 | && calc_pixel_width_or_height (&tem, it, prop, font, false, NULL)) | 32065 | && calc_pixel_width_or_height (&tem, it, prop, font, false, NULL)) |