mirror of
https://github.com/ARMSX2/ARMSX2.git
synced 2026-08-24 16:50:16 -07:00
GzippedFileReader: Don't write OOB in last chunk
zlib_indexed can write the full span to the block, despite the length being shorter. This code can die in a fire. Closes #11398.
This commit is contained in:
@@ -223,7 +223,7 @@ ThreadedFileReader::Chunk GzippedFileReader::ChunkForOffset(u64 offset)
|
||||
else
|
||||
{
|
||||
chunk.chunkID = static_cast<s64>(offset) / m_index->span;
|
||||
chunk.length = static_cast<u32>(std::min<u64>(m_index->uncompressed_size - offset, m_index->span));
|
||||
chunk.length = m_index->span;
|
||||
chunk.offset = static_cast<u64>(chunk.chunkID) * m_index->span;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user