mirror of
https://github.com/libretro/scummvm.git
synced 2024-12-17 07:07:10 +00:00
Fixed some cppcheck warnings.
svn-id: r45391
This commit is contained in:
parent
463ccc896a
commit
994408a770
@ -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;
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user