mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-22 22:00:39 -06:00
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:
@ -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);
|
||||
|
Reference in New Issue
Block a user