summaryrefslogtreecommitdiff
path: root/Source/Core/DiscIO/Blob.cpp
diff options
context:
space:
mode:
authorJosJuice <josjuice@gmail.com>2020-01-13 22:08:44 +0100
committerJosJuice <josjuice@gmail.com>2020-01-14 18:59:31 +0100
commit297b790e4f14be284df39d5ac67e59527df41e29 (patch)
tree1eacf88c9627bd62ba37320cc3d8d9fa2d43e525 /Source/Core/DiscIO/Blob.cpp
parent31d7b56c19e44df568a979ffca43fd18fcd8e658 (diff)
DiscIO: Add out of bounds checks for blob reading
Diffstat (limited to 'Source/Core/DiscIO/Blob.cpp')
-rw-r--r--Source/Core/DiscIO/Blob.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/Source/Core/DiscIO/Blob.cpp b/Source/Core/DiscIO/Blob.cpp
index a53c908eaf..20fe23e9ca 100644
--- a/Source/Core/DiscIO/Blob.cpp
+++ b/Source/Core/DiscIO/Blob.cpp
@@ -96,6 +96,9 @@ const SectorReader::Cache* SectorReader::GetCacheLine(u64 block_num)
bool SectorReader::Read(u64 offset, u64 size, u8* out_ptr)
{
+ if (offset + size > GetDataSize())
+ return false;
+
u64 remain = size;
u64 block = 0;
u32 position_in_block = static_cast<u32>(offset % m_block_size);