diff options
| author | 2015-01-06 22:47:43 +0000 | |
|---|---|---|
| committer | 2015-01-15 22:23:07 +0100 | |
| commit | 04622a859cc748745cbbeb0b332f930085438077 (patch) | |
| tree | 3aaf5244552971eb47bbbc8319f06fe4834f1460 /src/core/loader/elf.cpp | |
| parent | Loader: Keep a reference to the file and pass it to the correct AppLoader, in... (diff) | |
| download | yuzu-04622a859cc748745cbbeb0b332f930085438077.tar.gz yuzu-04622a859cc748745cbbeb0b332f930085438077.tar.xz yuzu-04622a859cc748745cbbeb0b332f930085438077.zip | |
Loader: Don’t assume the file hasn’t been read before.
Diffstat (limited to 'src/core/loader/elf.cpp')
| -rw-r--r-- | src/core/loader/elf.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/core/loader/elf.cpp b/src/core/loader/elf.cpp index d1a1ef595..712d564d1 100644 --- a/src/core/loader/elf.cpp +++ b/src/core/loader/elf.cpp | |||
| @@ -337,6 +337,9 @@ ResultStatus AppLoader_ELF::Load() { | |||
| 337 | if (!file->IsOpen()) | 337 | if (!file->IsOpen()) |
| 338 | return ResultStatus::Error; | 338 | return ResultStatus::Error; |
| 339 | 339 | ||
| 340 | // Reset read pointer in case this file has been read before. | ||
| 341 | file->Seek(0, SEEK_SET); | ||
| 342 | |||
| 340 | u32 size = static_cast<u32>(file->GetSize()); | 343 | u32 size = static_cast<u32>(file->GetSize()); |
| 341 | std::unique_ptr<u8[]> buffer(new u8[size]); | 344 | std::unique_ptr<u8[]> buffer(new u8[size]); |
| 342 | file->ReadBytes(&buffer[0], size); | 345 | file->ReadBytes(&buffer[0], size); |