diff options
author | Willem Jan Palenstijn | 2011-08-22 08:53:42 +0200 |
---|---|---|
committer | Willem Jan Palenstijn | 2011-08-22 08:57:06 +0200 |
commit | 4f748884bc48cea7d92b7c28b53744a9a92c2f0c (patch) | |
tree | f5b942cc6a4ea5bda64f125b0aa7ab76d7b058d5 /engines/scumm/smush/channel.cpp | |
parent | ae19be062824c7e17632d2c4da7ba5c2f4624095 (diff) | |
parent | c39b7491e6a23450ae0dc41ca6f3c3b06ed91c2e (diff) | |
download | scummvm-rg350-4f748884bc48cea7d92b7c28b53744a9a92c2f0c.tar.gz scummvm-rg350-4f748884bc48cea7d92b7c28b53744a9a92c2f0c.tar.bz2 scummvm-rg350-4f748884bc48cea7d92b7c28b53744a9a92c2f0c.zip |
Merge pull request #67 from chrisws/initial-bada-port-master
This is the initial implementation of the BADA port.
Diffstat (limited to 'engines/scumm/smush/channel.cpp')
-rw-r--r-- | engines/scumm/smush/channel.cpp | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/engines/scumm/smush/channel.cpp b/engines/scumm/smush/channel.cpp index 7f71d0549b..f5e0747ba8 100644 --- a/engines/scumm/smush/channel.cpp +++ b/engines/scumm/smush/channel.cpp @@ -94,14 +94,16 @@ void SmushChannel::processBuffer() { _tbufferSize = 0; } else { if (offset) { - byte *old = _tbuffer; int32 new_size = _tbufferSize - offset; - _tbuffer = (byte *)malloc(new_size); - if (!_tbuffer) - error("smush channel failed to allocate memory"); - memcpy(_tbuffer, old + offset, new_size); - _tbufferSize = new_size; - free(old); + if (new_size) { + byte *old = _tbuffer; + _tbuffer = (byte *)malloc(new_size); + if (!_tbuffer) + error("smush channel failed to allocate memory"); + memcpy(_tbuffer, old + offset, new_size); + _tbufferSize = new_size; + free(old); + } } } } |