summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author AJR <ajrhacker@users.noreply.github.com>2017-06-08 17:49:42 -0400
committer AJR <ajrhacker@users.noreply.github.com>2017-06-08 17:49:42 -0400
commit49b0de5a211d6e1ac492c87c3f2cbbf9b1c42578 (patch)
tree810b569f40fdfb741b160e31eb830f7d75053868
parent16d40d58249ec90f3713e2a10bc733b1fba05b60 (diff)
Avert potential crash (nw)
-rw-r--r--src/mame/machine/taitoio.cpp3
1 files changed, 2 insertions, 1 deletions
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 */