Banshee: Skip address wrap during display update to avoid segfault.

Original Banshee / Voodoo3 VGABIOS reporting wrong number of image pages in
VBE mode info of at least mode 640x480x8. Issue found with vbetest program.
This commit is contained in:
Volker Ruppert 2024-05-25 22:21:37 +02:00
parent 426bd50b90
commit 244e35af87
1 changed files with 7 additions and 1 deletions

View File

@ -597,7 +597,13 @@ void bx_voodoo_base_c::update(void)
}
iWidth = s.vdraw.width;
iHeight = s.vdraw.height;
Bit8u *disp_ptr = &v->fbi.ram[start & v->fbi.mask];
start &= v->fbi.mask;
Bit8u *disp_ptr = &v->fbi.ram[start];
if ((start + pitch * iHeight) > v->fbi.mask) {
BX_ERROR(("update(): skip address wrap (start = 0x%08x)", start));
BX_UNLOCK(render_mutex);
return;
}
if (bx_gui->graphics_tile_info_common(&info)) {
if (info.snapshot_mode) {