From 951ffcd4be9c3699957cd1cd5a134eaf1c476c68 Mon Sep 17 00:00:00 2001 From: hap Date: Sun, 4 Dec 2022 15:53:19 +0100 Subject: aerfboot: remove possible spriteram oob access --- src/mame/vsystem/aerofgt_v.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/mame/vsystem/aerofgt_v.cpp b/src/mame/vsystem/aerofgt_v.cpp index 05bd6d84d7b..91aebfc1e14 100644 --- a/src/mame/vsystem/aerofgt_v.cpp +++ b/src/mame/vsystem/aerofgt_v.cpp @@ -563,6 +563,7 @@ void aerofgt_state::aerfboot_draw_sprites( screen_device &screen, bitmap_ind16 & int attr_start, last; last = ((m_rasterram[0x404 / 2] << 5) - 0x8000) / 2; + if (last < 0) last = 0; for (attr_start = m_spriteram.bytes() / 2 - 4; attr_start >= last; attr_start -= 4) { @@ -601,6 +602,7 @@ void aerofgt_state::aerfboot_draw_sprites( screen_device &screen, bitmap_ind16 & } last = ((m_rasterram[0x402 / 2] << 5) - 0x8000) / 2; + if (last < 0) last = 0; for (attr_start = ((m_spriteram.bytes() / 2) / 2) - 4; attr_start >= last; attr_start -= 4) { @@ -704,7 +706,6 @@ uint32_t aerofgt_state::screen_update_spikes91(screen_device &screen, bitmap_ind (x*8)+24,(y*8)+8,15); count++; - } } -- cgit v1.2.3