summaryrefslogtreecommitdiffstats
path: root/src/core/loader/elf.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/loader/elf.cpp')
-rw-r--r--src/core/loader/elf.cpp3
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() {
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);