mirror of
https://github.com/holub/mame
synced 2025-06-05 20:33:45 +03:00
formats/fs_fat.cpp: Guard against divide by zero errors when the bytes per sector field in the parameter block is not properly set (as on some early PC-DOS disks)
This commit is contained in:
parent
93eb3514b1
commit
94ee92901b
@ -564,6 +564,8 @@ impl::impl(fsblk_t &blockdev, fsblk_t::block_t &&boot_sector_block, std::vector<
|
||||
, m_last_cluster_indicator(((u64)1 << bits_per_fat_entry) - 1)
|
||||
, m_last_valid_cluster(m_last_cluster_indicator - 0x10)
|
||||
{
|
||||
if (m_bytes_per_sector == 0)
|
||||
m_bytes_per_sector = 512;
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user