diff options
| author | Tillmann Karras <tilkax@gmail.com> | 2015-09-16 21:06:54 +0200 |
|---|---|---|
| committer | Tillmann Karras <tilkax@gmail.com> | 2015-10-12 02:35:43 +0200 |
| commit | 00aefa5e08a9aa6865a14706dcf35346993fa517 (patch) | |
| tree | b22bc09b7e3c5876b801f02207273e1c5dfe5bcf /Source/Core/DiscIO/Blob.cpp | |
| parent | efe71e686b8b89e87e2c10237e4d33bc4bfdf54f (diff) | |
DolphinWX: decompress discs to calculate MD5 hash
Diffstat (limited to 'Source/Core/DiscIO/Blob.cpp')
| -rw-r--r-- | Source/Core/DiscIO/Blob.cpp | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/Source/Core/DiscIO/Blob.cpp b/Source/Core/DiscIO/Blob.cpp index 9ed8577c38..1a2333f198 100644 --- a/Source/Core/DiscIO/Blob.cpp +++ b/Source/Core/DiscIO/Blob.cpp @@ -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; |
