diff options
author | Chris Warren-Smith | 2011-10-17 22:35:48 +1000 |
---|---|---|
committer | Chris Warren-Smith | 2011-10-18 23:22:25 +1000 |
commit | ed07b99b22c2cf092f207dc15b26801c502534ac (patch) | |
tree | d9da48b5e0385d36c09aac398bc8306d7c5a63e1 /engines | |
parent | ca7bc7184652be9673045f5d810ec4bd310c120c (diff) | |
download | scummvm-rg350-ed07b99b22c2cf092f207dc15b26801c502534ac.tar.gz scummvm-rg350-ed07b99b22c2cf092f207dc15b26801c502534ac.tar.bz2 scummvm-rg350-ed07b99b22c2cf092f207dc15b26801c502534ac.zip |
BADA: Misc changes merged from appstore release
Diffstat (limited to 'engines')
-rw-r--r-- | engines/scumm/smush/channel.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/engines/scumm/smush/channel.cpp b/engines/scumm/smush/channel.cpp index fd822f56b6..7f9ca70080 100644 --- a/engines/scumm/smush/channel.cpp +++ b/engines/scumm/smush/channel.cpp @@ -99,11 +99,13 @@ void SmushChannel::processBuffer() { byte *old = _tbuffer; int32 new_size = _tbufferSize - offset; _tbuffer = (byte *)malloc(new_size); - // FIXME: _tbuffer might be 0 if new_size is 0. // NB: Also check other "if (_tbuffer)" locations in smush - if (!_tbuffer) - error("smush channel failed to allocate memory"); - memcpy(_tbuffer, old + offset, new_size); + if (!_tbuffer) { + if (new_size) + error("smush channel failed to allocate memory"); + } else { + memcpy(_tbuffer, old + offset, new_size); + } _tbufferSize = new_size; free(old); } |