aboutsummaryrefslogtreecommitdiffstats
path: root/com32/lib/sys/vesa/initvesa.c
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2008-02-13 18:03:17 -0800
committerH. Peter Anvin <hpa@zytor.com>2008-02-13 18:03:17 -0800
commit2079650b3e6dbe302fe27e5256fd412894c2f4b9 (patch)
treefb019871e140ef37c04784b3856d1596091a51e2 /com32/lib/sys/vesa/initvesa.c
parent4d36df22fcb042a595300fb7d61b64b58caf018d (diff)
downloadsyslinux-2079650b3e6dbe302fe27e5256fd412894c2f4b9.tar.gz
syslinux-2079650b3e6dbe302fe27e5256fd412894c2f4b9.tar.xz
syslinux-2079650b3e6dbe302fe27e5256fd412894c2f4b9.zip
Fix the calculation of bytes_per_pixel
Handle cases where __vesa_info.mi.bpp is not a multiple of 8, e.g. 15. Remove totally redundant switch statement in vesacon_update_characters().
Diffstat (limited to 'com32/lib/sys/vesa/initvesa.c')
-rw-r--r--com32/lib/sys/vesa/initvesa.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/com32/lib/sys/vesa/initvesa.c b/com32/lib/sys/vesa/initvesa.c
index abea95aa..d5aa9ba7 100644
--- a/com32/lib/sys/vesa/initvesa.c
+++ b/com32/lib/sys/vesa/initvesa.c
@@ -235,7 +235,7 @@ static int vesacon_set_mode(void)
mi = &__vesa_info.mi;
mode = bestmode;
- __vesacon_bytes_per_pixel = mi->bpp >> 3;
+ __vesacon_bytes_per_pixel = (mi->bpp+7) >> 3;
/* Download the SYSLINUX- or BIOS-provided font */
rm.eax.w[0] = 0x0018; /* Query custom font */