COMMON: Support MacBinary3 files produced by ISOBuster

This commit is contained in:
Eugene Sandulenko 2020-08-01 20:18:24 +02:00
parent 7f7e5ea6bc
commit 4221c38167

View file

@ -424,10 +424,11 @@ bool MacResManager::loadFromMacBinary(SeekableReadStream &stream) {
uint32 rsrcSize = READ_BE_UINT32(infoHeader + MBI_RFLEN);
uint32 dataSizePad = (((dataSize + 127) >> 7) << 7);
uint32 rsrcSizePad = (((rsrcSize + 127) >> 7) << 7);
// Files produced by ISOBuster are not padded, thus, compare with the actual size
//uint32 rsrcSizePad = (((rsrcSize + 127) >> 7) << 7);
// Length check
if (MBI_INFOHDR + dataSizePad + rsrcSizePad == (uint32)stream.size()) {
if (MBI_INFOHDR + dataSizePad + rsrcSize <= (uint32)stream.size()) {
_resForkOffset = MBI_INFOHDR + dataSizePad;
_resForkSize = rsrcSize;
}