From b814617b65550c6f5a86336f048ae14b312b4136 Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Sat, 31 Oct 2015 18:14:41 +0100 Subject: [PATCH] Fix error in sample device (nw) --- src/devices/sound/samples.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/devices/sound/samples.c b/src/devices/sound/samples.c index 863e30f0832..964c21e2b22 100644 --- a/src/devices/sound/samples.c +++ b/src/devices/sound/samples.c @@ -84,8 +84,8 @@ void samples_device::start(UINT8 channel, UINT32 samplenum, bool loop) chan.stream->update(); // update the parameters - sample_t &sample = m_sample[samplenum]; - chan.source = &sample.data[0]; + sample_t &sample = m_sample[samplenum]; + chan.source = (sample.data.size() > 0) ? &sample.data[0] : NULL; chan.source_length = sample.data.size(); chan.source_num = (chan.source_length > 0) ? samplenum : -1; chan.pos = 0;