Loader: Don’t assume the file hasn’t been read before.

This commit is contained in:
Emmanuel Gil Peyrot 2015-01-06 22:47:43 +00:00
parent b5237e885d
commit 04622a859c
3 changed files with 13 additions and 4 deletions

View file

@ -100,6 +100,9 @@ static THREEDSX_Error Load3DSXFile(FileUtil::IOFile& file, u32 base_addr)
if (!file.IsOpen())
return ERROR_FILE;
// Reset read pointer in case this file has been read before.
file.Seek(0, SEEK_SET);
THREEDSX_Header hdr;
if (file.ReadBytes(&hdr, sizeof(hdr)) != sizeof(hdr))
return ERROR_READ;