summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/sound
diff options
context:
space:
mode:
author therealmogminer@gmail.com <therealmogminer@gmail.com>2016-01-21 20:53:29 +0100
committer Miodrag Milanovic <mmicko@gmail.com>2016-01-23 17:30:14 +0100
commit3e4605ebffaedb2d1d3b0c43afe829312044ea5c (patch)
tree31e80a51fb218b6d7e866da12bfad6843750300d /src/devices/sound
parentf5d65e4583a434df2b1d5c34aef11d6e01b041b7 (diff)
More null fixes, nw
Diffstat (limited to 'src/devices/sound')
-rw-r--r--src/devices/sound/es5506.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/devices/sound/es5506.cpp b/src/devices/sound/es5506.cpp
index 792da85298b..7a27d7575f7 100644
--- a/src/devices/sound/es5506.cpp
+++ b/src/devices/sound/es5506.cpp
@@ -366,8 +366,16 @@ void es5505_device::device_start()
m_stream = machine().sound().stream_alloc(*this, 0, 2 * channels, clock() / (16*32));
/* initialize the regions */
- m_region_base[0] = m_region0 ? (UINT16 *)machine().root_device().memregion(m_region0)->base() : nullptr;
- m_region_base[1] = m_region1 ? (UINT16 *)machine().root_device().memregion(m_region1)->base() : nullptr;
+ if (m_region0)
+ {
+ memory_region* region = machine().root_device().memregion(m_region0);
+ m_region_base[0] = region ? reinterpret_cast<UINT16 *>(region->base()) : nullptr;
+ }
+ if (m_region1)
+ {
+ memory_region* region = machine().root_device().memregion(m_region1);
+ m_region_base[1] = region ? reinterpret_cast<UINT16 *>(region->base()) : nullptr;
+ }
/* initialize the rest of the structure */
m_master_clock = clock();