mirror of
https://github.com/PabloMK7/citra
synced 2024-11-15 05:08:23 +00:00
Do not use the cache if the read would result in OOB (#130)
This commit is contained in:
parent
2e9d7bd208
commit
64e3e9ffaa
1 changed files with 1 additions and 1 deletions
|
@ -383,7 +383,7 @@ ResultVal<std::size_t> ArticFileBackend::Read(u64 offset, std::size_t length, u8
|
||||||
auto cache = cache_provider->ProvideCache(
|
auto cache = cache_provider->ProvideCache(
|
||||||
client, cache_provider->PathsToVector(archive_path, file_path), true);
|
client, cache_provider->PathsToVector(archive_path, file_path), true);
|
||||||
|
|
||||||
if (cache != nullptr) {
|
if (cache != nullptr && (offset + static_cast<u64>(length)) < GetSize()) {
|
||||||
return cache->Read(file_handle, offset, length, buffer);
|
return cache->Read(file_handle, offset, length, buffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue