Permalink
Browse files

Merge pull request #7582 from AdmiralCurtiss/memcard-delete-wrong-dir

GCMemcard: Fix incorrect directory block being accessed in RemoveFile().
  • Loading branch information...
delroth committed Nov 22, 2018
2 parents fe8854d + 431e6c4 commit 0c6d67723322522e03b6ec6eb4fe8c8b3ad5182f
Showing with 2 additions and 2 deletions.
  1. +2 −2 Source/Core/Core/HW/GCMemcard/GCMemcard.cpp
@@ -739,8 +739,8 @@ u32 GCMemcard::RemoveFile(u8 index) // index in the directory array
if (index >= DIRLEN)
return DELETE_FAIL;

u16 startingblock = BE16(dir.Dir[index].FirstBlock);
u16 numberofblocks = BE16(dir.Dir[index].BlockCount);
u16 startingblock = BE16(CurrentDir->Dir[index].FirstBlock);
u16 numberofblocks = BE16(CurrentDir->Dir[index].BlockCount);

BlockAlloc UpdatedBat = *CurrentBat;
if (!UpdatedBat.ClearBlocks(startingblock, numberofblocks))

0 comments on commit 0c6d677

Please sign in to comment.