From 1ba94341834d2846ca3bde3e5c1154fb365b7360 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Johan=20Bockg=C3=A5rd?= Date: Mon, 9 Jan 2012 17:44:18 +0800 Subject: [PATCH] Avoid crash on composition (backport from trunk). * xdisp.c (fill_composite_glyph_string): Always set s->face, to avoid a crash (bug#9496). --- src/ChangeLog | 5 +++++ src/xdisp.c | 6 ++++++ 2 files changed, 11 insertions(+) diff --git a/src/ChangeLog b/src/ChangeLog index fcaff20727d..7cfb3aa61e1 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2011-11-11 Johan Bockgård + + * xdisp.c (fill_composite_glyph_string): Always set s->face, to + avoid a crash (bug#9496). + 2012-01-09 Chong Yidong * xdisp.c (note_mouse_highlight): Fix use of uninitialized var. diff --git a/src/xdisp.c b/src/xdisp.c index c0c11bf02d2..ca61947be8b 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -19635,6 +19635,12 @@ fill_composite_glyph_string (s, base_face, overlaps) } s->cmp_to = i; + if (s->face == NULL) + { + s->face = base_face->ascii_face; + s->font = s->face->font; + } + /* All glyph strings for the same composition has the same width, i.e. the width set for the first component of the composition. */ s->width = s->first_glyph->pixel_width; -- 2.39.5