TRECISION: Revert, change the way _compBuffer is allocated

This commit is contained in:
Strangerke 2021-05-19 13:27:23 +01:00 committed by SupSuper
parent 1df6a9b138
commit fa55ae2fc6

View File

@ -68,7 +68,7 @@ bool FastFile::open(const Common::String &name) {
void FastFile::close() { void FastFile::close() {
delete _stream; delete _stream;
_stream = nullptr; _stream = nullptr;
delete[] _compStream; delete _compStream;
_compStream = nullptr; _compStream = nullptr;
_fileEntries.clear(); _fileEntries.clear();
} }
@ -159,8 +159,8 @@ Common::SeekableReadStream *FastFile::createReadStreamForCompressedMember(const
uint8 *ibuf = new uint8[dataSize]; uint8 *ibuf = new uint8[dataSize];
const int32 realSize = MAX(dataSize, decompSize) + 8 + 100; // add extra padding for the decompressor const int32 realSize = MAX(dataSize, decompSize) + 8 + 100; // add extra padding for the decompressor
delete[] _compStream; delete _compStream;
_compBuffer = new uint8[realSize]; _compBuffer = (uint8 *) malloc (realSize);
ff->read(ibuf, dataSize); ff->read(ibuf, dataSize);
delete ff; delete ff;