diff options
author | Torbjörn Andersson | 2009-10-26 06:20:13 +0000 |
---|---|---|
committer | Torbjörn Andersson | 2009-10-26 06:20:13 +0000 |
commit | 994408a770a50cf698eb98e67b7b54d41b9b6a88 (patch) | |
tree | 7db0e12d6a2af8e3832b80d675966f79feacae54 /engines/sci | |
parent | 463ccc896af1e024784abe65f872e64226fe50ed (diff) | |
download | scummvm-rg350-994408a770a50cf698eb98e67b7b54d41b9b6a88.tar.gz scummvm-rg350-994408a770a50cf698eb98e67b7b54d41b9b6a88.tar.bz2 scummvm-rg350-994408a770a50cf698eb98e67b7b54d41b9b6a88.zip |
Fixed some cppcheck warnings.
svn-id: r45391
Diffstat (limited to 'engines/sci')
-rw-r--r-- | engines/sci/seq_decoder.cpp | 4 | ||||
-rw-r--r-- | engines/sci/sfx/softseq/amiga.cpp | 4 |
2 files changed, 6 insertions, 2 deletions
diff --git a/engines/sci/seq_decoder.cpp b/engines/sci/seq_decoder.cpp index b980103def..45c46d13c6 100644 --- a/engines/sci/seq_decoder.cpp +++ b/engines/sci/seq_decoder.cpp @@ -91,7 +91,7 @@ bool SeqDecoder::loadFile(const char *fileName, int frameDelay) { g_system->setPalette(palette, 0, 256); - delete paletteData; + delete[] paletteData; _videoInfo.firstframeOffset = _fileStream->pos(); @@ -144,7 +144,7 @@ bool SeqDecoder::decodeNextFrame() { byte *buf = new byte[frameSize]; _fileStream->read(buf, frameSize); decodeFrame(buf, rleSize, buf + rleSize, frameSize - rleSize, _videoFrameBuffer + 320 * frameTop, frameLeft, frameWidth, frameHeight, colorKey); - delete buf; + delete[] buf; } return ++_videoInfo.currentFrame < _videoInfo.frameCount; diff --git a/engines/sci/sfx/softseq/amiga.cpp b/engines/sci/sfx/softseq/amiga.cpp index 6094201169..388e5685fd 100644 --- a/engines/sci/sfx/softseq/amiga.cpp +++ b/engines/sci/sfx/softseq/amiga.cpp @@ -413,6 +413,8 @@ static instrument_t *read_instrument(Common::File &file, int *id) { instrument->samples = (int8 *) malloc(size + 1); if (file.read(instrument->samples, size) < (unsigned int)size) { warning("[sfx:seq:amiga] failed to read instrument samples"); + free(instrument->samples); + free(instrument); return NULL; } @@ -427,6 +429,8 @@ static instrument_t *read_instrument(Common::File &file, int *id) { if (seg_size[1] < 0) { warning("[sfx:seq:amiga] invalid looping point"); + free(instrument->samples); + free(instrument); return NULL; } |