diff options
author | Sven Hesse | 2010-10-15 13:56:14 +0000 |
---|---|---|
committer | Sven Hesse | 2010-10-15 13:56:14 +0000 |
commit | ccb35067199abdc0291d3ebbb55c85a9cea3fa8c (patch) | |
tree | 37e304cb8f0749c3c167f1056683488f561af0dc /graphics/video | |
parent | 81de95671c4a7bfc546db81c90a0a8b4a31349b1 (diff) | |
download | scummvm-rg350-ccb35067199abdc0291d3ebbb55c85a9cea3fa8c.tar.gz scummvm-rg350-ccb35067199abdc0291d3ebbb55c85a9cea3fa8c.tar.bz2 scummvm-rg350-ccb35067199abdc0291d3ebbb55c85a9cea3fa8c.zip |
GRAPHICS: Fix code analysis warnings
See bug report #3087917
svn-id: r53493
Diffstat (limited to 'graphics/video')
-rw-r--r-- | graphics/video/coktel_decoder.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/graphics/video/coktel_decoder.cpp b/graphics/video/coktel_decoder.cpp index 10be09eb23..cea902e3a0 100644 --- a/graphics/video/coktel_decoder.cpp +++ b/graphics/video/coktel_decoder.cpp @@ -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 = |