diff options
author | Bram Moolenaar <Bram@vim.org> | 2004-10-07 21:02:47 +0000 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2004-10-07 21:02:47 +0000 |
commit | 3fdfa4a9a52ab3d1a790262ee872a49853ad4626 (patch) | |
tree | 76f57a06a5f3b9e0abc15446b38722658fde7e1e /src/gui_gtk_x11.c | |
parent | e5f258eb4c4b87ea1d6f61c1a0a9deecbb5d9726 (diff) |
updated for version 7.0017v7.0017
Diffstat (limited to 'src/gui_gtk_x11.c')
-rw-r--r-- | src/gui_gtk_x11.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/gui_gtk_x11.c b/src/gui_gtk_x11.c index aed649b277..bc727733f3 100644 --- a/src/gui_gtk_x11.c +++ b/src/gui_gtk_x11.c @@ -5239,6 +5239,14 @@ not_ascii: int last_glyph_rbearing; int cells = 0; /* cells occupied by current cluster */ + /* Safety check: pango crashes when invoked with invalid utf-8 + * characters. */ + if (!utf_valid_string(s, s + len)) + { + column_offset = len; + goto skipitall; + } + /* original width of the current cluster */ cluster_width = PANGO_SCALE * gui.char_width; @@ -5372,6 +5380,7 @@ not_ascii: pango_attr_list_unref(attr_list); } +skipitall: if (flags & DRAW_UNDERL) gdk_draw_line(gui.drawarea->window, gui.text_gc, |