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

@ -337,6 +337,9 @@ ResultStatus AppLoader_ELF::Load() {
if (!file->IsOpen())
return ResultStatus::Error;
// Reset read pointer in case this file has been read before.
file->Seek(0, SEEK_SET);
u32 size = static_cast<u32>(file->GetSize());
std::unique_ptr<u8[]> buffer(new u8[size]);
file->ReadBytes(&buffer[0], size);