1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-12-22 10:26:20 +00:00

(x_draw_glyphs): Handle case START and END are out

of bounds more carefully.
This commit is contained in:
Gerd Moellmann 2000-09-08 09:35:57 +00:00
parent 6b7d4ae4d1
commit a8710abfaf
2 changed files with 9 additions and 2 deletions

View File

@ -1,3 +1,8 @@
2000-09-08 Gerd Moellmann <gerd@gnu.org>
* xterm.c (x_draw_glyphs): Handle case START and END are out
of bounds more carefully.
2000-09-08 Dave Love <fx@gnu.org>
* unexelf.c (SHT_MIPS_DEBUG, HDRR) [__mips__]: Really confine last

View File

@ -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;
}