Avoid segfaults due to freed face cache
* src/xfaces.c (face_at_buffer_position): Make sure DEFAULT_FACE is usable. (Bug#51864)
This commit is contained in:
parent
199e2468d3
commit
5044151486
1 changed files with 4 additions and 1 deletions
|
@ -6423,7 +6423,10 @@ face_at_buffer_position (struct window *w, ptrdiff_t pos,
|
||||||
else
|
else
|
||||||
face_id = lookup_basic_face (w, f, DEFAULT_FACE_ID);
|
face_id = lookup_basic_face (w, f, DEFAULT_FACE_ID);
|
||||||
|
|
||||||
default_face = FACE_FROM_ID (f, face_id);
|
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));
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Optimize common cases where we can use the default face. */
|
/* Optimize common cases where we can use the default face. */
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue