3dom2_te: fix array out of bounds access on m_tm.m_regs

This commit is contained in:
hap 2024-03-28 16:31:30 +01:00
parent 6583232209
commit 8202c76788

View File

@ -785,13 +785,13 @@ uint32_t m2_te_device::read(offs_t offset)
}
case 3:
{
if (reg < 0x400/4)
if (reg < 0x400 / 4)
{
return m_pipram[reg];
}
else if ((reg - 0x400) < sizeof(m_tm) / 4)
else if ((reg - 0x400 / 4) < sizeof(m_tm) / 4)
{
return m_tm.m_regs[reg];
return m_tm.m_regs[reg - 0x400 / 4];
}
break;