mirror of
https://github.com/ksherlock/profuse.git
synced 2024-12-22 20:29:59 +00:00
Support for 2MG w/o 0 filesize field (leadlight)
git-svn-id: https://profuse.googlecode.com/svn/branches/v2@397 aa027e90-d47c-11dd-86d7-074df07e0730
This commit is contained in:
parent
e3aea1657f
commit
5d219195bb
@ -107,6 +107,7 @@ bool UniversalDiskImage::Validate(MappedFile *file, const std::nothrow_t &)
|
||||
|
||||
unsigned blocks = 0;
|
||||
unsigned offset = 0;
|
||||
unsigned fileSize = 0;
|
||||
|
||||
|
||||
if (size < 64) return false;
|
||||
@ -121,8 +122,11 @@ bool UniversalDiskImage::Validate(MappedFile *file, const std::nothrow_t &)
|
||||
offset = Read32(data, 0x18);
|
||||
|
||||
// file size == blocks * 512
|
||||
if (Read32(data, 0x1c) != blocks * 512) return false;
|
||||
|
||||
// file size blank in some cases.
|
||||
//if (Read32(data, 0x1c) != blocks * 512) return false;
|
||||
fileSize = Read32(data, 0x1c);
|
||||
if (fileSize != 0 && fileSize != blocks * 512) return false;
|
||||
|
||||
if (offset + blocks * 512 > size) return false;
|
||||
|
||||
return true;
|
||||
|
Loading…
Reference in New Issue
Block a user