From 4a65a5da2045f19d249943c7e2e207456b2f29cb Mon Sep 17 00:00:00 2001 From: Alex Barney Date: Mon, 10 Dec 2018 16:22:51 -0600 Subject: [PATCH] Fix save data off-by-one error --- src/LibHac/IO/Save/AllocationTable.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/LibHac/IO/Save/AllocationTable.cs b/src/LibHac/IO/Save/AllocationTable.cs index 5edaf7f6..6269912a 100644 --- a/src/LibHac/IO/Save/AllocationTable.cs +++ b/src/LibHac/IO/Save/AllocationTable.cs @@ -17,7 +17,9 @@ namespace LibHac.IO.Save Header = new AllocationTableHeader(HeaderStorage); Stream tableStream = storage.AsStream(); - int blockCount = (int)(Header.AllocationTableBlockCount); + + // The first entry in the table is reserved. Block 0 is at table index 1 + int blockCount = (int)(Header.AllocationTableBlockCount) + 1; Entries = new AllocationTableEntry[blockCount]; tableStream.Position = 0;