# HG changeset patch # User Gerd Moellmann # Date 968405664 0 # Node ID 8bfcf0b562f23a0d4c1415c0297edc2cbafcf92f # Parent f66ae09a4d4cee639290654288aea829e2667421 (x_draw_glyphs): Handle case START and END are out of bounds more carefully. diff -r f66ae09a4d4c -r 8bfcf0b562f2 src/xterm.c --- a/src/xterm.c Fri Sep 08 09:25:16 2000 +0000 +++ b/src/xterm.c Fri Sep 08 09:34:24 2000 +0000 @@ -4693,8 +4693,9 @@ int i, j; /* Let's rather be paranoid than getting a SEGV. */ + end = min (end, row->used[area]); start = max (0, start); - end = min (end, row->used[area]); + start = min (end, start); if (real_start) *real_start = start; if (real_end) @@ -4748,7 +4749,7 @@ /* 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 @@ if (area > TEXT_AREA) x_reached -= window_box_width (w, TEXT_AREA); } + return x_reached; }