summaryrefslogtreecommitdiff
path: root/Source/Core/DiscIO/DirectoryBlob.cpp
diff options
context:
space:
mode:
authorJosJuice <josjuice@gmail.com>2020-02-09 11:21:10 +0100
committerJosJuice <josjuice@gmail.com>2020-02-09 11:21:10 +0100
commit9a348ae654e8a60bed3d1e240e253b0f40ee7746 (patch)
treeb87c1a2d207e1d490d6b3f053857274d737900ab /Source/Core/DiscIO/DirectoryBlob.cpp
parentf8f9dbdec3505515e78972bdd26474ae17b1d2d7 (diff)
DiscIO: Check for DirectoryBlob seek failure
Someone reported a problem with DirectoryBlob at https://forums.dolphin-emu.org/Thread-feature-request-thread?pid=502820#pid502820. I'm not sure if the change in this commit actually fixes that problem, but it's something I found that should be changed regardless.
Diffstat (limited to 'Source/Core/DiscIO/DirectoryBlob.cpp')
-rw-r--r--Source/Core/DiscIO/DirectoryBlob.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/Source/Core/DiscIO/DirectoryBlob.cpp b/Source/Core/DiscIO/DirectoryBlob.cpp
index 514fdc7c44..3df7b44256 100644
--- a/Source/Core/DiscIO/DirectoryBlob.cpp
+++ b/Source/Core/DiscIO/DirectoryBlob.cpp
@@ -104,8 +104,7 @@ bool DiscContent::Read(u64* offset, u64* length, u8** buffer) const
if (std::holds_alternative<std::string>(m_content_source))
{
File::IOFile file(std::get<std::string>(m_content_source), "rb");
- file.Seek(offset_in_content, SEEK_SET);
- if (!file.ReadBytes(*buffer, bytes_to_read))
+ if (!file.Seek(offset_in_content, SEEK_SET) || !file.ReadBytes(*buffer, bytes_to_read))
return false;
}
else