summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/r128_driver.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/r128_driver.c b/src/r128_driver.c
index 2eb9d26..8f360a1 100644
--- a/src/r128_driver.c
+++ b/src/r128_driver.c
@@ -488,7 +488,8 @@ static Bool R128GetBIOSParameters(ScrnInfoPtr pScrn, xf86Int10InfoPtr pInt10)
(info->VBIOS[(v) + 3] << 24))
#ifdef XSERVER_LIBPCIACCESS
- info->VBIOS = xalloc(info->PciInfo->rom_size);
+ int size = info->PciInfo->rom_size > R128_VBIOS_SIZE ? info->PciInfo->rom_size : R128_VBIOS_SIZE;
+ info->VBIOS = xalloc(size);
#else
info->VBIOS = xalloc(R128_VBIOS_SIZE);
#endif