diff options
Diffstat (limited to 'engines/scumm/smush/channel.cpp')
-rw-r--r-- | engines/scumm/smush/channel.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/engines/scumm/smush/channel.cpp b/engines/scumm/smush/channel.cpp index ccf67764e3..4389890994 100644 --- a/engines/scumm/smush/channel.cpp +++ b/engines/scumm/smush/channel.cpp @@ -41,8 +41,8 @@ SmushChannel::SmushChannel(int32 track) : } SmushChannel::~SmushChannel() { - delete[] _tbuffer; - delete[] _sbuffer; + free(_tbuffer); + free(_sbuffer); } void SmushChannel::processBuffer() { @@ -60,7 +60,7 @@ void SmushChannel::processBuffer() { _sbuffer = _tbuffer; if (offset < _tbufferSize) { int new_size = _tbufferSize - offset; - _tbuffer = new byte[new_size]; + _tbuffer = (byte *)malloc(new_size); if (!_tbuffer) error("smush channel failed to allocate memory"); memcpy(_tbuffer, _sbuffer + offset, new_size); @@ -70,7 +70,7 @@ void SmushChannel::processBuffer() { _tbufferSize = 0; } if (_sbufferSize == 0) { - delete[] _sbuffer; + free(_sbuffer); _sbuffer = 0; } } else { @@ -86,23 +86,23 @@ void SmushChannel::processBuffer() { if (_inData) { _sbufferSize = _tbufferSize - offset; assert(_sbufferSize); - _sbuffer = new byte[_sbufferSize]; + _sbuffer = (byte *)malloc(_sbufferSize); if (!_sbuffer) error("smush channel failed to allocate memory"); memcpy(_sbuffer, _tbuffer + offset, _sbufferSize); - delete[] _tbuffer; + free(_tbuffer); _tbuffer = 0; _tbufferSize = 0; } else { if (offset) { byte *old = _tbuffer; int32 new_size = _tbufferSize - offset; - _tbuffer = new byte[new_size]; + _tbuffer = (byte *)malloc(new_size); if (!_tbuffer) error("smush channel failed to allocate memory"); memcpy(_tbuffer, old + offset, new_size); _tbufferSize = new_size; - delete[] old; + free(old); } } } |