From 93025cc1156f7cb5c7d9121a15003e45aab28e13 Mon Sep 17 00:00:00 2001 From: OBattler Date: Tue, 6 May 2025 19:29:30 +0200 Subject: [PATCH] SM(S)C FDC 37c6xx: Return 0xFF on out of bound register read, fixes segmentation fault on the DEC Venturis 4xx. --- src/sio/sio_fdc37c6xx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sio/sio_fdc37c6xx.c b/src/sio/sio_fdc37c6xx.c index 0f3460565..3afd92e4c 100644 --- a/src/sio/sio_fdc37c6xx.c +++ b/src/sio/sio_fdc37c6xx.c @@ -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]; }