summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/sound
diff options
context:
space:
mode:
author Aaron Giles <aaron@aarongiles.com>2021-05-31 17:46:46 -0700
committer Aaron Giles <aaron@aarongiles.com>2021-05-31 17:46:46 -0700
commitb630ea12cd42b31cd927f68e1585953263a7dada (patch)
tree1d8f172710402f0ebce16c043695ce4ace0f089f /src/devices/sound
parent7b5e54a3dfdaa4865f15a3a2e5d8a3b303fe0a75 (diff)
bbd: Fix out of bounds accesses.
Diffstat (limited to 'src/devices/sound')
-rw-r--r--src/devices/sound/bbd.h2
1 files changed, 1 insertions, 1 deletions
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;