[Scummvm-cvs-logs] SF.net SVN: scummvm:[53493] scummvm/trunk/graphics/video/coktel_decoder.cpp
drmccoy at users.sourceforge.net
drmccoy at users.sourceforge.net
Fri Oct 15 15:56:14 CEST 2010
Revision: 53493
http://scummvm.svn.sourceforge.net/scummvm/?rev=53493&view=rev
Author: drmccoy
Date: 2010-10-15 13:56:14 +0000 (Fri, 15 Oct 2010)
Log Message:
-----------
GRAPHICS: Fix code analysis warnings
See bug report #3087917
Modified Paths:
--------------
scummvm/trunk/graphics/video/coktel_decoder.cpp
Modified: scummvm/trunk/graphics/video/coktel_decoder.cpp
===================================================================
--- scummvm/trunk/graphics/video/coktel_decoder.cpp 2010-10-15 13:55:46 UTC (rev 53492)
+++ scummvm/trunk/graphics/video/coktel_decoder.cpp 2010-10-15 13:56:14 UTC (rev 53493)
@@ -2301,12 +2301,15 @@
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 @@
free(data);
warning("VMDDecoder::getEmbeddedFile(): Couldn't read %d bytes (file \"%s\")",
file->realSize, fileName.c_str());
+ return 0;
}
Common::MemoryReadStream *stream =
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list