summaryrefslogtreecommitdiffstatshomepage
path: root/src
diff options
context:
space:
mode:
author Ted Green <tedgreen99@inbox.com>2016-06-09 18:24:02 -0600
committer Ted Green <tedgreen99@inbox.com>2016-06-09 18:24:16 -0600
commit0d9d3f866a8b5bc6cbc1995d555e4330134e4a8b (patch)
treedd1ee734f90c6f5826cf71d016f65b7b25834842 /src
parentaecbc11dd862851a022b722ee508f78897941ccd (diff)
dcs: Fix buffer overflow with sf2049se. (nw)
Diffstat (limited to 'src')
-rw-r--r--src/mame/audio/dcs.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/mame/audio/dcs.cpp b/src/mame/audio/dcs.cpp
index 17446242bda..36c99bc74da 100644
--- a/src/mame/audio/dcs.cpp
+++ b/src/mame/audio/dcs.cpp
@@ -1949,7 +1949,8 @@ TIMER_DEVICE_CALLBACK_MEMBER( dcs_audio_device::dcs_irq )
/* copy the current data into the buffer */
{
int count = m_size / (2*(m_incs ? m_incs : 1));
- INT16 buffer[0x400];
+ std::unique_ptr<INT16[]> buffer;
+ buffer = std::make_unique<INT16[]>(count);
int i;
for (i = 0; i < count; i++)
@@ -1959,7 +1960,7 @@ TIMER_DEVICE_CALLBACK_MEMBER( dcs_audio_device::dcs_irq )
}
if (m_channels)
- dmadac_transfer(&m_dmadac[0], m_channels, 1, m_channels, count / m_channels, buffer);
+ dmadac_transfer(&m_dmadac[0], m_channels, 1, m_channels, count / m_channels, buffer.get());
}
/* check for wrapping */