diff options
author | Matthew Hoops | 2011-08-26 22:44:17 -0400 |
---|---|---|
committer | Matthew Hoops | 2011-08-26 22:44:17 -0400 |
commit | 4a69dc13d92e82fff85dc5a3a923b74ced259ffa (patch) | |
tree | 8945cd3745fd65f28b043caf7b1beddbbce2b2a1 /engines/scumm/smush/channel.cpp | |
parent | ad293b249e74dd1cfbdbd721d02145efbdaf9eca (diff) | |
parent | 5e174cbfe466dbbe8e5470b0a00de1481b986181 (diff) | |
download | scummvm-rg350-4a69dc13d92e82fff85dc5a3a923b74ced259ffa.tar.gz scummvm-rg350-4a69dc13d92e82fff85dc5a3a923b74ced259ffa.tar.bz2 scummvm-rg350-4a69dc13d92e82fff85dc5a3a923b74ced259ffa.zip |
Merge remote branch 'upstream/master' into pegasus
Diffstat (limited to 'engines/scumm/smush/channel.cpp')
-rw-r--r-- | engines/scumm/smush/channel.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/engines/scumm/smush/channel.cpp b/engines/scumm/smush/channel.cpp index 7f71d0549b..fd822f56b6 100644 --- a/engines/scumm/smush/channel.cpp +++ b/engines/scumm/smush/channel.cpp @@ -60,6 +60,8 @@ void SmushChannel::processBuffer() { if (offset < _tbufferSize) { int 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, _sbuffer + offset, new_size); @@ -97,6 +99,8 @@ 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); |