diff options
author | Eli Zaretskii <eliz@gnu.org> | 2022-01-14 16:11:34 +0200 |
---|---|---|
committer | Eli Zaretskii <eliz@gnu.org> | 2022-01-14 16:11:34 +0200 |
commit | c05864dd25c820fe250672d32d6ec77ba946670d (patch) | |
tree | 15bc60cee0f648ed878f60526c409b43ef255af0 | |
parent | 281b878858b381762ac74a96c85d383e8f423db9 (diff) | |
download | emacs-c05864dd25c820fe250672d32d6ec77ba946670d.tar.gz |
Avoid another segfault in 'face_at_buffer_position'
* src/xfaces.c (face_at_buffer_position): Make really sure the
default face is usable. (Bug#53254)
-rw-r--r-- | src/xfaces.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/xfaces.c b/src/xfaces.c index b9fb7c0ac1e..dff5ae346de 100644 --- a/src/xfaces.c +++ b/src/xfaces.c @@ -6425,8 +6425,12 @@ face_at_buffer_position (struct window *w, ptrdiff_t pos, default_face = FACE_FROM_ID_OR_NULL (f, face_id); if (!default_face) - default_face = FACE_FROM_ID (f, - lookup_basic_face (w, f, DEFAULT_FACE_ID)); + { + if (FRAME_FACE_CACHE (f)->used == 0) + recompute_basic_faces (f); + default_face = FACE_FROM_ID (f, + lookup_basic_face (w, f, DEFAULT_FACE_ID)); + } } /* Optimize common cases where we can use the default face. */ |