From ccb35067199abdc0291d3ebbb55c85a9cea3fa8c Mon Sep 17 00:00:00 2001 From: Sven Hesse Date: Fri, 15 Oct 2010 13:56:14 +0000 Subject: GRAPHICS: Fix code analysis warnings See bug report #3087917 svn-id: r53493 --- graphics/video/coktel_decoder.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'graphics') 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 = -- cgit v1.2.3