Fixed crash on startup.

This commit is contained in:
nat 2014-03-26 02:24:15 +00:00
parent 15ad9601a0
commit d23bcbae49
3 changed files with 22 additions and 2 deletions

View file

@ -1,7 +1,8 @@
# $NetBSD: Makefile,v 1.31 2014/02/06 10:40:19 wiz Exp $
# $NetBSD: Makefile,v 1.32 2014/03/26 02:24:15 nat Exp $
DISTNAME= mame0152s
PKGNAME= ${DISTNAME:S/mame0/mess-0./:S/s$//}
PKGREVISION= 1
MASTER_SITES= http://mamedev.org/downloader.php?file=releases/
COMMENT= Multi Emulator Super System

View file

@ -1,8 +1,9 @@
$NetBSD: distinfo,v 1.17 2014/02/06 10:40:19 wiz Exp $
$NetBSD: distinfo,v 1.18 2014/03/26 02:24:15 nat Exp $
SHA1 (mame0152s.zip) = 2e11509b39c13dc1336a48a102813589b0793788
RMD160 (mame0152s.zip) = d8f4accbd639e085c6165374d7b7ebd427d3c4d7
Size (mame0152s.zip) = 36247883 bytes
SHA1 (patch-src_emu_emualloc.c) = 6df67d1d1aaf982444db3db65c066bc83644ae9b
SHA1 (patch-src_emu_emualloc.h) = 22cdfbc002cda8053125ef8cedf3bcceea04deaf
SHA1 (patch-src_emu_netlist_nl__base.h) = 9ee165f601da849a339699f560c371bc58dd0d83
SHA1 (patch-src_emu_netlist_nl__lists.h) = d31c9cf715f66520e4a1a09584f1c52bbea74fef

View file

@ -0,0 +1,18 @@
$NetBSD: patch-src_emu_emualloc.c,v 1.1 2014/03/26 02:24:15 nat Exp $
This resolves a crash on startup.
--- src/emu/emualloc.c.orig 2013-10-15 22:14:50.000000000 +0000
+++ src/emu/emualloc.c
@@ -266,6 +266,11 @@ void resource_pool::add(resource_pool_it
memory_entry *entry = memory_entry::find(item.m_ptr);
if (entry == NULL)
entry = memory_entry::find(reinterpret_cast<UINT8 *>(item.m_ptr) - sizeof(size_t));
+ if (entry == NULL) {
+ osd_lock_release(m_listlock);
+ return;
+ }
+
assert(entry != NULL);
item.m_id = entry->m_id;
if (LOG_ALLOCS)