From 49b0de5a211d6e1ac492c87c3f2cbbf9b1c42578 Mon Sep 17 00:00:00 2001 From: AJR Date: Thu, 8 Jun 2017 17:49:42 -0400 Subject: Avert potential crash (nw) --- src/mame/machine/taitoio.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/mame/machine/taitoio.cpp b/src/mame/machine/taitoio.cpp index 9e8187fdaf7..6466ee51926 100644 --- a/src/mame/machine/taitoio.cpp +++ b/src/mame/machine/taitoio.cpp @@ -183,7 +183,8 @@ READ8_MEMBER( tc0040ioc_device::portreg_r ) WRITE8_MEMBER( tc0040ioc_device::portreg_w ) { - m_regs[m_port] = data; + if (m_port < ARRAY_LENGTH(m_regs)) + m_regs[m_port] = data; switch (m_port) { case 0x04: /* coin counters and lockout, hi nibble irrelevant */ -- cgit v1.2.3