From: Gerd Moellmann Date: Fri, 8 Sep 2000 09:35:57 +0000 (+0000) Subject: (x_draw_glyphs): Handle case START and END are out X-Git-Tag: emacs-pretest-21.0.90~1707 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=a8710abfaf9468e6d1ff5d2533eafca17b43718b;p=emacs.git (x_draw_glyphs): Handle case START and END are out of bounds more carefully. --- diff --git a/src/ChangeLog b/src/ChangeLog index 5e9690bd845..86f72ecda45 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2000-09-08 Gerd Moellmann + + * xterm.c (x_draw_glyphs): Handle case START and END are out + of bounds more carefully. + 2000-09-08 Dave Love * unexelf.c (SHT_MIPS_DEBUG, HDRR) [__mips__]: Really confine last diff --git a/src/xterm.c b/src/xterm.c index 73ccf6040a6..f72b20cda50 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -4693,8 +4693,9 @@ x_draw_glyphs (w, x, row, area, start, end, hl, real_start, real_end, int i, j; /* Let's rather be paranoid than getting a SEGV. */ - start = max (0, start); end = min (end, row->used[area]); + start = max (0, start); + start = min (end, start); if (real_start) *real_start = start; if (real_end) @@ -4748,7 +4749,7 @@ x_draw_glyphs (w, x, row, area, start, end, hl, real_start, real_end, /* If there are any glyphs with lbearing < 0 or rbearing > width in the row, redraw some glyphs in front or following the glyph strings built above. */ - if (!overlaps_p && row->contains_overlapping_glyphs_p) + if (head && !overlaps_p && row->contains_overlapping_glyphs_p) { int dummy_x = 0; struct glyph_string *h, *t; @@ -4847,6 +4848,7 @@ x_draw_glyphs (w, x, row, area, start, end, hl, real_start, real_end, if (area > TEXT_AREA) x_reached -= window_box_width (w, TEXT_AREA); } + return x_reached; }