GRAPHICS: Fix code analysis warnings

See bug report #3087917

svn-id: r53493
This commit is contained in:
Sven Hesse 2010-10-15 13:56:14 +00:00
parent 81de95671c
commit ccb3506719

View File

@ -2301,12 +2301,15 @@ byte *VMDDecoder::deDPCM(const byte *data, uint32 &size, int32 init[2]) {
uint32 outSize = size + channels;
int16 *out = (int16 *)malloc(outSize * 2);
byte *sound = (byte *) out;
byte *sound = (byte *)out;
if (!out)
return 0;
int channel = 0;
for (int i = 0; i < channels; i++) {
*out++ = TO_BE_16(init[channel]);
*out++ = TO_BE_16(init[channel]);
channel = (channel + 1) % channels;
}
@ -2464,6 +2467,7 @@ Common::MemoryReadStream *VMDDecoder::getEmbeddedFile(const Common::String &file
free(data);
warning("VMDDecoder::getEmbeddedFile(): Couldn't read %d bytes (file \"%s\")",
file->realSize, fileName.c_str());
return 0;
}
Common::MemoryReadStream *stream =