Fixed some cppcheck warnings.

svn-id: r45391
This commit is contained in:
Torbjörn Andersson 2009-10-26 06:20:13 +00:00
parent 463ccc896a
commit 994408a770
2 changed files with 6 additions and 2 deletions

View File

@ -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;

View File

@ -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;
}