summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author AJR <ajrhacker@users.noreply.github.com>2021-08-16 15:28:52 -0400
committer AJR <ajrhacker@users.noreply.github.com>2021-08-16 15:28:52 -0400
commit3025c17f20ba2ee67f85ce6bdb77d90465e2d660 (patch)
treef2713d9a0c82dc9a216862283da993e76546f4b2
parent554b073a068662dade16915829e0c4699fcea43d (diff)
Fix exception in debug memory viewer selecting a floating point format when the number of chunks per row is too small
-rw-r--r--src/emu/debug/dvmemory.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/emu/debug/dvmemory.cpp b/src/emu/debug/dvmemory.cpp
index 1a239419f8d..fea8def590e 100644
--- a/src/emu/debug/dvmemory.cpp
+++ b/src/emu/debug/dvmemory.cpp
@@ -1026,6 +1026,8 @@ void debug_view_memory::set_data_format(data_format format)
m_bytes_per_chunk = get_posdata(format).m_bytes;
m_chunks_per_row = m_bytes_per_row / m_bytes_per_chunk;
+ if (m_chunks_per_row < 1)
+ m_chunks_per_row = 1;
m_steps_per_chunk = source.m_space ? source.m_space->byte_to_address(m_bytes_per_chunk) : m_bytes_per_chunk;
pos.m_shift = 0;
pos.m_address -= pos.m_address % m_bytes_per_chunk;