]> git.eshelyaron.com Git - emacs.git/commitdiff
(x_draw_glyphs): Handle case START and END are out
authorGerd Moellmann <gerd@gnu.org>
Fri, 8 Sep 2000 09:35:57 +0000 (09:35 +0000)
committerGerd Moellmann <gerd@gnu.org>
Fri, 8 Sep 2000 09:35:57 +0000 (09:35 +0000)
of bounds more carefully.

src/ChangeLog
src/xterm.c

index 5e9690bd845f8b08104855f25fc6d4596175ff05..86f72ecda45a42e1dbf294f8199b8dbf72f1548a 100644 (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
index 73ccf6040a6f50f6e2b577cb4d3465f7f8a3f9f8..f72b20cda5007a2e962755f70e9d59740de383a8 100644 (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;
 }