summaryrefslogtreecommitdiff
path: root/Source/Core/DiscIO/FileBlob.cpp
diff options
context:
space:
mode:
authorJosJuice <josjuice@gmail.com>2014-12-14 13:16:21 +0100
committerJosJuice <josjuice@gmail.com>2014-12-14 13:16:21 +0100
commit467b3e6bafdeeea57c8150d1373a5781d0601a46 (patch)
tree16d7c4cfe2c3b9eb57a11a9219c3dad9019f3247 /Source/Core/DiscIO/FileBlob.cpp
parentd02eb3ca59c8ca435aae617ff1484525c796a330 (diff)
DiscIO: Clear error status when reading file
Diffstat (limited to 'Source/Core/DiscIO/FileBlob.cpp')
-rw-r--r--Source/Core/DiscIO/FileBlob.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/Source/Core/DiscIO/FileBlob.cpp b/Source/Core/DiscIO/FileBlob.cpp
index d7c4467738..9cf14cb0b4 100644
--- a/Source/Core/DiscIO/FileBlob.cpp
+++ b/Source/Core/DiscIO/FileBlob.cpp
@@ -25,8 +25,15 @@ PlainFileReader* PlainFileReader::Create(const std::string& filename)
bool PlainFileReader::Read(u64 offset, u64 nbytes, u8* out_ptr)
{
- m_file.Seek(offset, SEEK_SET);
- return m_file.ReadBytes(out_ptr, nbytes);
+ if (m_file.Seek(offset, SEEK_SET) && m_file.ReadBytes(out_ptr, nbytes))
+ {
+ return true;
+ }
+ else
+ {
+ m_file.Clear();
+ return false;
+ }
}
} // namespace