diff --git a/Source/Core/DiscIO/DirectoryBlob.cpp b/Source/Core/DiscIO/DirectoryBlob.cpp index 295235c605..193d74c244 100644 --- a/Source/Core/DiscIO/DirectoryBlob.cpp +++ b/Source/Core/DiscIO/DirectoryBlob.cpp @@ -663,10 +663,14 @@ void DirectoryBlobReader::SetPartitions(std::vector&& partiti SetPartitionHeader(&partitions[i].partition, partition_address); - const u64 data_size = partitions[i].partition.GetDataSize(); + const u64 data_size = + Common::AlignUp(partitions[i].partition.GetDataSize(), VolumeWii::BLOCK_DATA_SIZE); + partitions[i].partition.SetDataSize(data_size); + const u64 encrypted_data_size = + (data_size / VolumeWii::BLOCK_DATA_SIZE) * VolumeWii::BLOCK_TOTAL_SIZE; const u64 partition_data_offset = partition_address + PARTITION_DATA_OFFSET; m_partitions.emplace(partition_data_offset, std::move(partitions[i].partition)); - m_nonpartition_contents.Add(partition_data_offset, data_size, + m_nonpartition_contents.Add(partition_data_offset, encrypted_data_size, ContentPartition{this, 0, partition_data_offset}); const u64 unaligned_next_partition_address = VolumeWii::OffsetInHashedPartitionToRawOffset( data_size, Partition(partition_address), PARTITION_DATA_OFFSET); diff --git a/Source/Core/DiscIO/DirectoryBlob.h b/Source/Core/DiscIO/DirectoryBlob.h index f616adc876..fea877f729 100644 --- a/Source/Core/DiscIO/DirectoryBlob.h +++ b/Source/Core/DiscIO/DirectoryBlob.h @@ -204,6 +204,7 @@ public: bool IsWii() const { return m_is_wii; } u64 GetDataSize() const { return m_data_size; } + void SetDataSize(u64 size) { m_data_size = size; } const std::string& GetRootDirectory() const { return m_root_directory; } const std::vector& GetHeader() const { return m_disc_header; } const DiscContentContainer& GetContents() const { return m_contents; }