aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2013-09-13 16:21:10 -0400
committerKevin O'Connor <kevin@koconnor.net>2013-09-18 20:48:33 -0400
commit0db698888c0f21f7fc72159f765257774bb304d8 (patch)
treedcbb3e26455cd27dc28d426e8051007163bcc161
parent68f56aa6e9d25f0e95c61dfe89b83ccc55383472 (diff)
downloadseabios-0db698888c0f21f7fc72159f765257774bb304d8.tar.gz
vgabios: Limit the range of the VBE number of "pages" parameter.
Looking at the output of other VGA BIOS implementations, it appears that the number of available video pages reported is always between 1 and 127. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
-rw-r--r--vgasrc/vbe.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/vgasrc/vbe.c b/vgasrc/vbe.c
index d962333..2c08736 100644
--- a/vgasrc/vbe.c
+++ b/vgasrc/vbe.c
@@ -144,6 +144,10 @@ vbe_104f01(struct bregs *regs)
mode_attr |= VBE_MODE_ATTRIBUTE_LINEAR_FRAME_BUFFER_MODE;
break;
}
+ if (pages > 128)
+ pages = 128;
+ if (pages < 2)
+ pages++;
SET_FARVAR(seg, info->mode_attributes, mode_attr);
SET_FARVAR(seg, info->planes, planes);
SET_FARVAR(seg, info->pages, pages - 1);