[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-stable] [PATCH stable-0.15 24/36] console: Fix rendering of VGA un
From: |
Andreas Färber |
Subject: |
[Qemu-stable] [PATCH stable-0.15 24/36] console: Fix rendering of VGA underline |
Date: |
Wed, 28 Mar 2012 14:52:27 +0200 |
From: Markus Armbruster <address@hidden>
vga_putcharxy()'s underline code sets font_data to 0xffff instead of
0xff. vga_putcharxy() then reads dmask16[0xffff >> 4] and
dmask4[0xffff >> 6]. In practice, these out-of-bounds subscripts
"only" put a few crap bits into the display surface.
For 32 bit pixels, there's no array access. font_data's extra bits go
straight into the display surface.
Broken when commit 6d6f7c28 implemented underline.
Spotted by Coverity.
Signed-off-by: Markus Armbruster <address@hidden>
Signed-off-by: Anthony Liguori <address@hidden>
(cherry picked from commit 439229c7cb97f6c4cddd3965c3e9d2b8319fe83c)
Signed-off-by: Bruce Rogers <address@hidden>
Signed-off-by: Andreas Färber <address@hidden>
---
console.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/console.c b/console.c
index 242086c..07c82b8 100644
--- a/console.c
+++ b/console.c
@@ -461,7 +461,7 @@ static void vga_putcharxy(DisplayState *ds, int x, int y,
int ch,
font_data = *font_ptr++;
if (t_attrib->uline
&& ((i == FONT_HEIGHT - 2) || (i == FONT_HEIGHT - 3))) {
- font_data = 0xFFFF;
+ font_data = 0xFF;
}
((uint32_t *)d)[0] = (dmask16[(font_data >> 4)] & xorcol) ^ bgcol;
((uint32_t *)d)[1] = (dmask16[(font_data >> 0) & 0xf] & xorcol) ^
bgcol;
@@ -474,7 +474,7 @@ static void vga_putcharxy(DisplayState *ds, int x, int y,
int ch,
font_data = *font_ptr++;
if (t_attrib->uline
&& ((i == FONT_HEIGHT - 2) || (i == FONT_HEIGHT - 3))) {
- font_data = 0xFFFF;
+ font_data = 0xFF;
}
((uint32_t *)d)[0] = (dmask4[(font_data >> 6)] & xorcol) ^ bgcol;
((uint32_t *)d)[1] = (dmask4[(font_data >> 4) & 3] & xorcol) ^
bgcol;
@@ -487,7 +487,7 @@ static void vga_putcharxy(DisplayState *ds, int x, int y,
int ch,
for(i = 0; i < FONT_HEIGHT; i++) {
font_data = *font_ptr++;
if (t_attrib->uline && ((i == FONT_HEIGHT - 2) || (i ==
FONT_HEIGHT - 3))) {
- font_data = 0xFFFF;
+ font_data = 0xFF;
}
((uint32_t *)d)[0] = (-((font_data >> 7)) & xorcol) ^ bgcol;
((uint32_t *)d)[1] = (-((font_data >> 6) & 1) & xorcol) ^ bgcol;
--
1.7.7
- [Qemu-stable] [PATCH stable-0.15 18/36] block/curl: Implement a flush function on the fd handlers, (continued)
- [Qemu-stable] [PATCH stable-0.15 18/36] block/curl: Implement a flush function on the fd handlers, Andreas Färber, 2012/03/28
- [Qemu-stable] [PATCH stable-0.15 16/36] vvfat: Fix potential buffer overflow, Andreas Färber, 2012/03/28
- [Qemu-stable] [PATCH stable-0.15 32/36] Error check find_ram_offset, Andreas Färber, 2012/03/28
- [Qemu-stable] [PATCH stable-0.15 31/36] cpu-common: Have a ram_addr_t of uint64 with Xen., Andreas Färber, 2012/03/28
- [Qemu-stable] [PATCH stable-0.15 36/36] qemu_vmalloc: align properly for transparent hugepages and KVM, Andreas Färber, 2012/03/28
- [Qemu-stable] [PATCH stable-0.15 21/36] Teach block/vdi about "discarded" (no longer allocated) blocks, Andreas Färber, 2012/03/28
- [Qemu-stable] [PATCH stable-0.15 30/36] pc: Fix floppy drives with if=none, Andreas Färber, 2012/03/28
- [Qemu-stable] [PATCH stable-0.15 22/36] vmdk: Improve error handling, Andreas Färber, 2012/03/28
- [Qemu-stable] [PATCH stable-0.15 28/36] qxl: stride fixup, Andreas Färber, 2012/03/28
- [Qemu-stable] [PATCH stable-0.15 26/36] qcow: Fix bdrv_write_compressed error handling, Andreas Färber, 2012/03/28
- [Qemu-stable] [PATCH stable-0.15 24/36] console: Fix rendering of VGA underline,
Andreas Färber <=
- [Qemu-stable] [PATCH stable-0.15 19/36] hda: do not mix output and input streams, RHBZ #740493, Andreas Färber, 2012/03/28
- Re: [Qemu-stable] [Qemu-devel] [PATCH stable-0.15 00/36] Preparing 0.15.2, Stefan Weil, 2012/03/28