From b630ea12cd42b31cd927f68e1585953263a7dada Mon Sep 17 00:00:00 2001 From: Aaron Giles Date: Mon, 31 May 2021 17:46:46 -0700 Subject: bbd: Fix out of bounds accesses. --- src/devices/sound/bbd.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/devices/sound/bbd.h b/src/devices/sound/bbd.h index aa307d283c2..b39e13e08cb 100644 --- a/src/devices/sound/bbd.h +++ b/src/devices/sound/bbd.h @@ -36,7 +36,7 @@ protected: protected: // override to convert clock to sample rate - stream_buffer::sample_t outputval(s32 index) const { return m_buffer[m_curpos + Entries + index]; } + stream_buffer::sample_t outputval(s32 index) const { return m_buffer[(m_curpos + Entries + index) % std::size(m_buffer)]; } virtual u32 sample_rate() const { return clock(); } sound_stream * m_stream; -- cgit v1.2.3