mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-29 12:19:12 +00:00
DiscIO: Clear error status when reading file
This commit is contained in:
parent
d02eb3ca59
commit
467b3e6baf
3 changed files with 17 additions and 3 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue