Author: dumbbell
Date: Mon Aug 25 16:56:33 2014
New Revision: 270587
URL: http://svnweb.freebsd.org/changeset/base/270587

Log:
  vt(4): Take font offset into account in vt_is_cursor_in_area()
  
  This fixes a "General protection fault" in vt_vga, where
  vt_is_cursor_in_area() erroneously reported that the cursor was over the
  text. This led to negative integers stored in "unsigned int" and chaos.
  
  MFC after:    1 week

Modified:
  head/sys/dev/vt/vt_core.c

Modified: head/sys/dev/vt/vt_core.c
==============================================================================
--- head/sys/dev/vt/vt_core.c   Mon Aug 25 16:25:18 2014        (r270586)
+++ head/sys/dev/vt/vt_core.c   Mon Aug 25 16:56:33 2014        (r270587)
@@ -828,8 +828,8 @@ vt_is_cursor_in_area(const struct vt_dev
         * We use the cursor position saved during the current refresh,
         * in case the cursor moved since.
         */
-       mx = vd->vd_mx_drawn;
-       my = vd->vd_my_drawn;
+       mx = vd->vd_mx_drawn + vd->vd_curwindow->vw_offset.tp_col;
+       my = vd->vd_my_drawn + vd->vd_curwindow->vw_offset.tp_row;
 
        x1 = area->tr_begin.tp_col;
        y1 = area->tr_begin.tp_row;
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to