Fixes for crashes if firstblock or numblocks is > 2049

Fixes some memory leaks, removes duplicate function
some information about hdr added

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@1311 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
LPFaint99
2008-11-27 05:30:18 +00:00
parent 69e978f9e2
commit af46362f34
3 changed files with 62 additions and 45 deletions

View File

@ -664,9 +664,11 @@ bool CMemcardManager::ReloadMemcard(const char *fileName, int card, int page)
m_MemcardList[card]->SetItem(index, COLUMN_BANNER, wxEmptyString);
m_MemcardList[card]->SetItem(index, COLUMN_TITLE, wxString::FromAscii(title));
m_MemcardList[card]->SetItem(index, COLUMN_COMMENT, wxString::FromAscii(comment));
if (!memoryCard[card]->GetNumBlocks(j, &blocks)) blocks = 0;
blocks = memoryCard[card]->GetFileSize(j);
if (blocks == 0xFFFF) blocks = 0;
wxBlock.Printf(wxT("%10d"), blocks);
if (!memoryCard[card]->GetFirstBlock(j,&firstblock)) firstblock = 0;
firstblock = memoryCard[card]->GetFirstBlock(j);
if (firstblock == 0xFFFF) firstblock = 3; // to make firstblock -1
wxFirstBlock.Printf(wxT("%10d"), firstblock-4);
m_MemcardList[card]->SetItem(index,COLUMN_BLOCKS, wxBlock);
m_MemcardList[card]->SetItem(index,COLUMN_FIRSTBLOCK, wxFirstBlock);