mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-09-03 16:16:05 +00:00
DolphinWX: decompress discs to calculate MD5 hash
This commit is contained in:
parent
efe71e686b
commit
00aefa5e08
2 changed files with 12 additions and 14 deletions
|
@ -77,23 +77,19 @@ bool SectorReader::Read(u64 offset, u64 size, u8* out_ptr)
|
|||
continue;
|
||||
}
|
||||
|
||||
const u8* data = GetBlockData(block);
|
||||
if (!data)
|
||||
return false;
|
||||
|
||||
u32 toCopy = m_blocksize - positionInBlock;
|
||||
if (toCopy >= remain)
|
||||
{
|
||||
const u8* data = GetBlockData(block);
|
||||
if (!data)
|
||||
return false;
|
||||
|
||||
// Yay, we are done!
|
||||
memcpy(out_ptr, data + positionInBlock, (size_t)remain);
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
const u8* data = GetBlockData(block);
|
||||
if (!data)
|
||||
return false;
|
||||
|
||||
memcpy(out_ptr, data + positionInBlock, toCopy);
|
||||
out_ptr += toCopy;
|
||||
remain -= toCopy;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue