aboutsummaryrefslogtreecommitdiff
path: root/engines/scumm/smush/channel.cpp
diff options
context:
space:
mode:
authorEugene Sandulenko2011-10-19 05:03:46 -0700
committerEugene Sandulenko2011-10-19 05:03:46 -0700
commit19134ecf7e543600fda7e9855ee4b3aa6822548c (patch)
treeae2f3917075cceb3ce74c34013bd48459f384c9d /engines/scumm/smush/channel.cpp
parent84bc5651271f70e470099a19ab197ef038ef4a3b (diff)
parented07b99b22c2cf092f207dc15b26801c502534ac (diff)
downloadscummvm-rg350-19134ecf7e543600fda7e9855ee4b3aa6822548c.tar.gz
scummvm-rg350-19134ecf7e543600fda7e9855ee4b3aa6822548c.tar.bz2
scummvm-rg350-19134ecf7e543600fda7e9855ee4b3aa6822548c.zip
Merge pull request #106 from chrisws/branch-1-4-c
BADA: Misc changes merged from appstore release
Diffstat (limited to 'engines/scumm/smush/channel.cpp')
-rw-r--r--engines/scumm/smush/channel.cpp10
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);
}