From e440c631ed446b50984155ef95f508a88988cfaf Mon Sep 17 00:00:00 2001 From: Oliver Stöneberg Date: Sun, 10 Aug 2014 03:43:22 +0000 Subject: added assert for index out-of-bounds access with sc4dnda (nw) --- src/emu/machine/68307tmu.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/emu/machine/68307tmu.c') diff --git a/src/emu/machine/68307tmu.c b/src/emu/machine/68307tmu.c index 65b480aace2..ac64bf01614 100644 --- a/src/emu/machine/68307tmu.c +++ b/src/emu/machine/68307tmu.c @@ -155,6 +155,7 @@ UINT16 m68307_timer::read_tcn(UINT16 mem_mask, int which) void m68307_timer::write_ter(UINT16 data, UINT16 mem_mask, int which) { + assert(which >= 0 && which < ARRAY_LENGTH(singletimer)); m68307_single_timer* tptr = &singletimer[which]; if (data & 0x2) tptr->regs[m68307TIMER_TMR] &= ~0x2; } @@ -212,6 +213,7 @@ void m68307_timer::write_tmr(UINT16 data, UINT16 mem_mask, int which) void m68307_timer::write_trr(UINT16 data, UINT16 mem_mask, int which) { + assert(which >= 0 && which < ARRAY_LENGTH(singletimer)); m68307_single_timer* tptr = &singletimer[which]; COMBINE_DATA(&tptr->regs[m68307TIMER_TRR]); -- cgit v1.2.3-70-g09d2