audit.c: fixed a crash occurring when trying to mount

a CHD from the internal UI. [Fabio Priuli]

out of whatsnew: this is the correct fix which replaces the hacky workaround that I had submitted earlier today...
This commit is contained in:
etabeta78 2015-06-03 00:37:29 +02:00
parent 8923954751
commit 06cc1e484d
2 changed files with 2 additions and 7 deletions

View File

@ -462,16 +462,10 @@ audit_record *media_auditor::audit_one_disk(const rom_entry *rom, const char *lo
{
// allocate and append a new record
audit_record &record = m_record_list.append(*global_alloc(audit_record(*rom, audit_record::MEDIA_DISK)));
chd_error err;
// open the disk
chd_file source;
if (&m_enumerator.driver() != NULL)
err = chd_error(open_disk_image(m_enumerator.options(), &m_enumerator.driver(), rom, source, locationtag));
else
// FIXME: this shouldn't be needed, but when trying to load a CDROM from the internal UI for some reason
// the enumerator is created with NULL driver() and we have to catch it by passing through the current options
err = chd_error(open_disk_image(m_enumerator.options(), &m_enumerator.driver(m_enumerator.find(m_enumerator.options().system_name())), rom, source, locationtag));
chd_error err = chd_error(open_disk_image(m_enumerator.options(), &m_enumerator.driver(), rom, source, locationtag));
// if we succeeded, get the hashes
if (err == CHDERR_NONE)

View File

@ -134,6 +134,7 @@ void ui_menu_control_device_image::load_software_part()
std::string temp_name = std::string(sld->list_name()).append(":").append(swi->shortname()).append(":").append(swp->name());
driver_enumerator drivlist(machine().options(), machine().options().system_name());
drivlist.next();
media_auditor auditor(drivlist);
media_auditor::summary summary = auditor.audit_software(sld->list_name(), (software_info *)swi, AUDIT_VALIDATE_FAST);
// if everything looks good, load software