]> xenbits.xensource.com Git - seabios.git/commitdiff
vgabios: int1009 handler bug limits count to 256 characters.
authorKevin O'Connor <kevin@koconnor.net>
Mon, 5 Mar 2012 22:11:50 +0000 (17:11 -0500)
committerKevin O'Connor <kevin@koconnor.net>
Tue, 6 Mar 2012 12:18:38 +0000 (07:18 -0500)
Fix bug (u8 overflow) causing large screen fills to fail.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
vgasrc/vgabios.c

index 58e467d70c41f58b2af5037ebc57adddfc154dfc..faf57b16376c4cbad4f804165e78d9b94a1a57eb 100644 (file)
@@ -510,10 +510,15 @@ handle_1008(struct bregs *regs)
 static void noinline
 write_chars(u8 page, struct carattr ca, u16 count)
 {
+    u16 nbcols = GET_BDA(video_cols);
     struct cursorpos cp = get_cursor_pos(page);
     while (count--) {
         vgafb_write_char(cp, ca);
         cp.x++;
+        if (cp.x >= nbcols) {
+            cp.x -= nbcols;
+            cp.y++;
+        }
     }
 }