diff options
author | Matthew Hoops | 2011-12-12 15:25:28 -0500 |
---|---|---|
committer | Matthew Hoops | 2011-12-12 15:25:28 -0500 |
commit | 00279659b22cbd5db739d5351e83a9fc2a2ae408 (patch) | |
tree | 497f06f46820043cbdf1725652b8f0073223e24a /engines/scumm/smush | |
parent | d932df79bed5aac97e17c0920a5e75cb5ce733ee (diff) | |
parent | d1628feb761acc9f4607f64de3eb620fea53bcc9 (diff) | |
download | scummvm-rg350-00279659b22cbd5db739d5351e83a9fc2a2ae408.tar.gz scummvm-rg350-00279659b22cbd5db739d5351e83a9fc2a2ae408.tar.bz2 scummvm-rg350-00279659b22cbd5db739d5351e83a9fc2a2ae408.zip |
Merge remote branch 'upstream/master' into pegasus
Conflicts:
video/qt_decoder.cpp
Diffstat (limited to 'engines/scumm/smush')
-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); } |