SM(S)C FDC 37c6xx: Return 0xFF on out of bound register read, fixes segmentation fault on the DEC Venturis 4xx.

This commit is contained in:
OBattler
2025-05-06 19:29:30 +02:00
parent ef3f57b338
commit 93025cc115

View File

@@ -232,7 +232,7 @@ fdc37c6xx_read(uint16_t port, void *priv)
uint8_t ret = 0xff;
if (dev->tries == 2) {
if (port == 0x3f1)
if ((port == 0x3f1) && (dev->cur_reg <= dev->max_reg))
ret = dev->regs[dev->cur_reg];
}