pcsx2:cdvd: Fix memleak

CID 146832 (#4-1 of 6): Non-array delete for scalars (DELETE_ARRAY)

ScopedPtr is for non-array objects only. Use ScopedArray instead.
This commit is contained in:
Jonathan Li 2015-09-13 23:20:26 +01:00
parent 69d27dfb4b
commit 39c5cd4f84
1 changed files with 3 additions and 4 deletions

View File

@ -85,20 +85,19 @@ bool BlockdumpFileReader::Open(const wxString& fileName)
m_file->SeekI(BlockDumpHeaderSize);
ScopedPtr<u8> buffer;
u32 bs = 1024*1024;
u32 off = 0;
u32 has = 0;
int i = 0;
buffer = new u8[bs];
ScopedArray<u8> buffer(bs);
do {
m_file->Read(buffer, bs);
m_file->Read(buffer.GetPtr(), bs);
has = m_file->LastRead();
while (i < m_dtablesize && off < has)
{
m_dtable[i++] = *(u32*)(buffer + off);
m_dtable[i++] = *(u32*)(buffer.GetPtr() + off);
off += 4;
off += m_blocksize;
}